diff --git a/.lando.base.yml b/.lando.base.yml index ed46f6d927..2c3dc6e9a9 100644 --- a/.lando.base.yml +++ b/.lando.base.yml @@ -15,8 +15,6 @@ name: wordpressdev recipe: wordpress config: - php: '7.2' - via: nginx webroot: public database: mariadb xdebug: false @@ -27,11 +25,19 @@ env_file: services: appserver: + type: php:custom + overrides: + image: westonruter/php:7.3-with-node12 + build: + context: ./ + dockerfile: Dockerfile + environment: + # Support debugging with XDEBUG. + PHP_IDE_CONFIG: "serverName=appserver" composer: # Note installing phpunit should be temporary because core should really install it via composer on its own. phpunit/phpunit: "^6" install_dependencies_as_root: - - bash bin/install-dependencies.sh # Allow loopback requests to work. - echo "127.0.0.1 wordpressdev.lndo.site" >> /etc/hosts run: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..75ac1e08bf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM devwithlando/php:7.3-fpm-2 + +# Choose the major node version +ENV NODE_VERSION=12 + +# Install node +RUN curl -sL "https://deb.nodesource.com/setup_${NODE_VERSION}.x" | bash - && apt-get install -y nodejs + +# Install yarn +RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - +RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list +RUN apt-get update +RUN apt-get install -y yarn + +# Add support for yaml. +RUN apt-get install -y libyaml-dev +RUN yes | pecl install yaml +RUN echo 'extension=yaml.so' > /usr/local/etc/php/conf.d/yaml.ini + +# Add other dependencies. +RUN apt-get install -y gnupg +RUN apt-get install -y zip +RUN apt-get install -y subversion + +# Add dependency for AMP plugin +RUN apt-get install -y protobuf-compiler python-protobuf diff --git a/bin/install-dependencies.sh b/bin/install-dependencies.sh deleted file mode 100755 index bd0294bab8..0000000000 --- a/bin/install-dependencies.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -# -# This scripts installs WordPressDev environment dependencies. -# -# WordPressDev, Copyright 2019 Google LLC -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -if [[ -z "$LANDO_MOUNT" ]]; then - echo "Error: Must be run the appserver."; - exit 1 -fi - -echo "Installing Dependencies" - -apt-get update -y -apt-get -y install libyaml-dev -yes | pecl install yaml -echo 'extension=yaml.so' > /usr/local/etc/php/conf.d/yaml.ini - -apt-get install gnupg -y - -curl -sL https://deb.nodesource.com/setup_12.x | bash - -apt-get install nodejs -y - -curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - -echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list -apt-get update -apt-get install yarn -y - -apt-get install zip -y -apt-get install subversion -y