From 912fdfc648f772f39b9127f37700fcea54ac5215 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Tue, 14 May 2019 15:46:21 +0930 Subject: [PATCH 01/23] Adding redis config and updating dockerfiles to add it in for development. --- docker-compose.linux.yml | 4 ++++ docker-compose.osx.yml | 4 ++++ src/Handler.php | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index f3bd4be..9fd9886 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -43,3 +43,7 @@ services: redis: image: redis:alpine network_mode: host + + memcached: + image: memcached:alpine + network_mode: host diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 95b5207..16bb974 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -54,6 +54,10 @@ services: image: redis:alpine network_mode: service:web + memcached: + image: memcached:alpine + network_mode: service:web + volumes: nfsmount: driver: local diff --git a/src/Handler.php b/src/Handler.php index 9c186f5..ee28425 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -177,6 +177,13 @@ public function generateSettings() " \$settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';\n" . " }\n" . "}\n" . + "if (getenv('MEMCACHE_ENABLED')) {\n" . + " \$settings['redis']['servers'] = getenv('MEMCACHE_HOST') ?: '127.0.0.1';\n" . + " // If we're not installing, include the memcache services.\n" . + " if (!isset(\$GLOBALS['install_state'])) {\n" . + " \$settings['cache']['default'] = 'cache.backend.memcache';\n\n" . + " }\n" . + "}\n" . "if (getenv('SHEPHERD_SECRET_PATH')) {\n" . " \$settings['shepherd_secrets'] = []; \n" . " // Glob the secret path for secrets, that match pattern \n" . From 35b727b5fec66eae0626fef3e5e84e0da8db7cf3 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 15 May 2019 14:44:46 +0930 Subject: [PATCH 02/23] Supporting memcache more correctly. --- docker-compose.linux.yml | 42 ++++++++++++++++++++++++++++------------ src/Handler.php | 6 ++++-- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 9fd9886..69e5901 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -2,9 +2,9 @@ version: '3' services: web: image: uofa/apache2-php7-dev:foundation - # This makes the container run on the same network stack as your - # workstation. Meaning that you can interact on "localhost". - network_mode: host + # Chrome webdriver requires this - used for tests. + privileged: true + hostname: ${PROJECT} environment: SITE_TITLE: WCMS D8 SITE_MAIL: site@example.com @@ -18,14 +18,22 @@ services: SHEPHERD_URL: http://shepherd.test SHEPHERD_TOKEN: super-secret-token SHEPHERD_INSTALL_PROFILE: ua - REDIS_ENABLED: 1 + DATABASE_HOST: db + REDIS_HOST: redis + MEMCACHE_ENABLED: 1 + MEMCACHE_HOST: memcache SHEPHERD_SECRET_PATH: /code/private - XDEBUG_CONFIG: "remote_host=127.0.0.1" - PHP_IDE_CONFIG: serverName=localhost + XDEBUG_CONFIG: "remote_host=172.17.0.1" + PHP_IDE_CONFIG: serverName=${PROJECT}.${DOMAIN} + VIRTUAL_HOST: ${PROJECT}.${DOMAIN} + # Do not define this as '/' or apache2 will give strange behaviour + # WEB_PATH: / volumes: - .:/code - ./shared:/shared - - $HOME/.ssh/id_rsa:/root/.ssh/id_rsa + - ${HOST_SSH_AUTH_SOCK_DIR}:/ssh + networks: + - default db: image: mariadb @@ -35,15 +43,25 @@ services: MYSQL_USER: user MYSQL_PASSWORD: password MYSQL_ROOT_PASSWORD: super-secret-password + networks: + - default mail: image: mailhog/mailhog - network_mode: host + environment: + VIRTUAL_HOST: mail.${PROJECT}.${DOMAIN} + networks: + - default redis: image: redis:alpine - network_mode: host + networks: + - default - memcached: - image: memcached:alpine - network_mode: host + memcache: + image: jboss/infinispan-server:9.4.11.Final + # Custom command to pass in the mode we want + command: | + docker-entrypoint.sh standalone-memcached + networks: + - default diff --git a/src/Handler.php b/src/Handler.php index ee28425..87a8e48 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -178,10 +178,12 @@ public function generateSettings() " }\n" . "}\n" . "if (getenv('MEMCACHE_ENABLED')) {\n" . - " \$settings['redis']['servers'] = getenv('MEMCACHE_HOST') ?: '127.0.0.1';\n" . + " \$settings['memcache']['servers'] = [getenv('MEMCACHE_HOST') . ':11211' => 'default'] ?: ['127.0.0.1:11211' => 'default'];\n" . + " \$settings['memcache']['bins'] = ['default' => 'default'];\n" . + " \$settings['memcache']['key_prefix'] = '';\n" . " // If we're not installing, include the memcache services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . - " \$settings['cache']['default'] = 'cache.backend.memcache';\n\n" . + " \$settings['cache']['default'] = 'cache.backend.memcache';\n" . " }\n" . "}\n" . "if (getenv('SHEPHERD_SECRET_PATH')) {\n" . From b1ca4f92b074add74d7ea75ddf0bbe9ea38e1bbc Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 15 May 2019 14:52:31 +0930 Subject: [PATCH 03/23] Add in the infinispan config file by default. Alphabetise other config file order. --- src/Handler.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Handler.php b/src/Handler.php index 87a8e48..c659ada 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -81,10 +81,11 @@ public function updateShepherdScaffoldFiles() [ 'docker-compose.linux.yml', 'docker-compose.osx.yml', - 'RoboFile.php', - 'drush/config-ignore.yml', 'drush/config-delete.yml', + 'drush/config-ignore.yml', 'phpcs.xml', + 'RoboFile.php', + 'standalone-memcached.xml', ] ); } From 00caeb661175c4b21f84fde8fe0a2032e330add6 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 15 May 2019 14:56:12 +0930 Subject: [PATCH 04/23] Missed the actual config file. --- standalone-memcached.xml | 351 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 standalone-memcached.xml diff --git a/standalone-memcached.xml b/standalone-memcached.xml new file mode 100644 index 0000000..3c38b2d --- /dev/null +++ b/standalone-memcached.xml @@ -0,0 +1,351 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE + h2 + + sa + sa + + + + + org.h2.jdbcx.JdbcDataSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From cc84598b11bc151c374813457ce38920dd772ead Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Tue, 21 May 2019 15:35:29 +0930 Subject: [PATCH 05/23] Adding infinispan container and updating build to support extending the s2i container. --- Dockerfile | 59 ++++++++++++++++++++++++++++++++++++++++ docker-compose.linux.yml | 22 ++++++++++----- docker-compose.osx.yml | 16 +++++++++-- dsh | 8 ++++-- 4 files changed, 94 insertions(+), 11 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ea6e1a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,59 @@ +FROM uofa/s2i-shepherd-drupal + +ARG USER_ID +ARG GROUP_ID + +# Need to switch from www-data to root to do the change of uid +USER 0:0 + +RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ + userdel -f www-data && \ + if getent group www-data ; then groupdel www-data; fi && \ + groupadd -g ${GROUP_ID} www-data && \ + useradd -l -u ${USER_ID} -g www-data www-data && \ + install -d -m 0755 -o www-data -g www-data /home/www-data && \ + chown --changes --no-dereference --recursive \ + --from=33 ${USER_ID}:${GROUP_ID} \ + /var/www \ + /run/lock \ + /var/run/apache2 \ + /var/log/apache2 \ + /var/lock/apache2 \ + /code \ + /shared \ + ;fi + +# Add the chromedriver repo using php, no wget or curl here. +RUN php -n -r 'echo file_get_contents("https://dl-ssl.google.com/linux/linux_signing_key.pub");' | apt-key add - \ +&& echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list + +# Upgrade all currently installed packages and install additional packages. +RUN apt-get update \ +&& apt-get -y install php-sqlite3 php-xdebug php7.2-cli git wget sudo unzip libnotify-bin google-chrome-stable vim \ +&& sed -ri 's/^zend.assertions\s*=\s*-1/zend.assertions = 1/g' /etc/php/7.2/cli/php.ini \ +&& sed -i 's/^\(allow_url_fopen\s*=\s*\).*$/\1on/g' /etc/php/7.2/mods-available/php_custom.ini \ +&& CHROME_DRIVER_VERSION=$(php -n -r 'echo file_get_contents("https://chromedriver.storage.googleapis.com/LATEST_RELEASE");') \ +&& wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ +&& unzip -o chromedriver_linux64.zip -d /usr/local/bin \ +&& rm -f chromedriver_linux64.zip \ +&& chmod +x /usr/local/bin/chromedriver \ +&& apt-get -y autoremove && apt-get -y autoclean && apt-get clean && rm -rf /var/lib/apt/lists /tmp/* /var/tmp/* + +# Install Composer. +RUN wget -q https://getcomposer.org/installer -O - | php -d allow_url_fopen=On -- --install-dir=/usr/local/bin --filename=composer + +RUN echo "zend_extension=xdebug.so" > /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.max_nesting_level=500" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.remote_enable=1" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.remote_handler=dbgp" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.remote_mode=req" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.remote_port=9000" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.remote_connect_back=1" >> /etc/php/7.2/mods-available/xdebug.ini \ +&& echo "xdebug.idekey=PHPSTORM" >> /etc/php/7.2/mods-available/xdebug.ini + +RUN echo "www-data ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/www-data + +# Enable xdebug. +RUN phpenmod -v ALL -s ALL xdebug + +USER www-data diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 69e5901..73231f3 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -1,7 +1,13 @@ version: '3' services: web: - image: uofa/apache2-php7-dev:foundation + build: + context: . + dockerfile: Dockerfile + args: + USER_ID: ${USER_ID:-1000} + GROUP_ID: ${GROUP_ID:-1000} + image: uofa/s2i-shepherd-drupal-dev # Chrome webdriver requires this - used for tests. privileged: true hostname: ${PROJECT} @@ -31,13 +37,12 @@ services: volumes: - .:/code - ./shared:/shared - - ${HOST_SSH_AUTH_SOCK_DIR}:/ssh + - ${XDG_RUNTIME_DIR}/keyring:/ssh networks: - default db: image: mariadb - network_mode: host environment: MYSQL_DATABASE: drupal MYSQL_USER: user @@ -58,10 +63,13 @@ services: networks: - default - memcache: + memcached: image: jboss/infinispan-server:9.4.11.Final - # Custom command to pass in the mode we want - command: | - docker-entrypoint.sh standalone-memcached + entrypoint: + - docker-entrypoint.sh + - -c + - standalone-memcached.xml + volumes: + - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml networks: - default diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 16bb974..6e8aea6 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -1,7 +1,13 @@ version: '3' services: web: - image: uofa/apache2-php7-dev:foundation + build: + context: . + dockerfile: Dockerfile + args: + USER_ID: ${USER_ID:-1000} + GROUP_ID: ${GROUP_ID:-1000} + image: uofa/s2i-shepherd-drupal-dev # You will notice that we are forwarding port which do not belong to PHP. # We have to declare them here because these "sidecar" services are sharing # THIS containers network stack. @@ -55,7 +61,13 @@ services: network_mode: service:web memcached: - image: memcached:alpine + image: jboss/infinispan-server:9.4.11.Final + entrypoint: + - docker-entrypoint.sh + - -c + - standalone-memcached.xml + volumes: + - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml network_mode: service:web volumes: diff --git a/dsh b/dsh index fb66f54..bf8d341 100755 --- a/dsh +++ b/dsh @@ -21,6 +21,10 @@ else export DOCKER_COMPOSE_FILE='docker-compose.linux.yml' fi +# Set user variables +USER_ID=$(id -u ${USER}) +GROUP_ID=$(id -g ${USER}) + # Setup some functions to output warnings. notice() { printf "\e[32;01m$1\e[39;49;00m\n" @@ -106,7 +110,7 @@ dsh_pull() { # Command: ./dsh nfs # Sets up NFS integration for OSX. NFS_FILE=/etc/exports -NFS_LINE="/Users -alldirs -mapall=$(id -u):$(id -g) localhost" +NFS_LINE="/Users -alldirs -mapall=${USER_ID}:${GROUP_ID} localhost" dsh_setup_nfs() { if [ ${HOST_TYPE} != "mac" ]; then echo "This script is OSX-only. Please do not run it on any other Unix." @@ -151,7 +155,7 @@ dsh_setup_nfs() { osascript -e 'quit app "Docker"' echo "== Resetting folder permissions..." - sudo chown -R "$(id -u)":"$(id -g)" . + sudo chown -R "${USER_ID}:${GROUP_ID}" . echo "== Setting up nfs..." sudo cp /dev/null "$NFS_FILE" From fc5a0c5c6e2fc539ce59ff3671f6b77f80776617 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Tue, 21 May 2019 15:36:53 +0930 Subject: [PATCH 06/23] Add Dockerfile into the list of default installed files. --- src/Handler.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Handler.php b/src/Handler.php index c659ada..f553e80 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -86,6 +86,7 @@ public function updateShepherdScaffoldFiles() 'phpcs.xml', 'RoboFile.php', 'standalone-memcached.xml', + 'Dockerfile', ] ); } From e761b710657c240916a0678457e2149e763ffd83 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 22 May 2019 13:58:59 +0930 Subject: [PATCH 07/23] Can't stand it any longer, we either alphabeticise, or group by related. --- docker-compose.linux.yml | 44 ++++++++++++++-------------------------- docker-compose.osx.yml | 32 ++++++++++------------------- 2 files changed, 26 insertions(+), 50 deletions(-) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 73231f3..b078490 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -12,28 +12,27 @@ services: privileged: true hostname: ${PROJECT} environment: + CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync + DATABASE_HOST: db + DATABASE_USER: user + DATABASE_PASSWORD: password + HASH_SALT: random-hash + PHP_IDE_CONFIG: serverName=${PROJECT:-shop8}.${DOMAIN:-172.17.0.1.xip.io} + PUBLIC_DIR: /shared/public + REDIS_ENABLED: 1 + REDIS_HOST: redis + SHEPHERD_SITE_ID: 2 + SHEPHERD_INSTALL_PROFILE: ua + SHEPHERD_SECRET_PATH: /code/private + SHEPHERD_TOKEN: super-secret-token + SHEPHERD_URL: http://shepherd.test SITE_TITLE: WCMS D8 SITE_MAIL: site@example.com SITE_ADMIN_EMAIL: admin@example.com SITE_ADMIN_USERNAME: admin SITE_ADMIN_PASSWORD: password - PUBLIC_DIR: /shared/public - HASH_SALT: random-hash - CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync - SHEPHERD_SITE_ID: 2 - SHEPHERD_URL: http://shepherd.test - SHEPHERD_TOKEN: super-secret-token - SHEPHERD_INSTALL_PROFILE: ua - DATABASE_HOST: db - REDIS_HOST: redis - MEMCACHE_ENABLED: 1 - MEMCACHE_HOST: memcache - SHEPHERD_SECRET_PATH: /code/private + VIRTUAL_HOST: ${PROJECT:-shop8}.${DOMAIN:-172.17.0.1.xip.io} XDEBUG_CONFIG: "remote_host=172.17.0.1" - PHP_IDE_CONFIG: serverName=${PROJECT}.${DOMAIN} - VIRTUAL_HOST: ${PROJECT}.${DOMAIN} - # Do not define this as '/' or apache2 will give strange behaviour - # WEB_PATH: / volumes: - .:/code - ./shared:/shared @@ -53,8 +52,6 @@ services: mail: image: mailhog/mailhog - environment: - VIRTUAL_HOST: mail.${PROJECT}.${DOMAIN} networks: - default @@ -62,14 +59,3 @@ services: image: redis:alpine networks: - default - - memcached: - image: jboss/infinispan-server:9.4.11.Final - entrypoint: - - docker-entrypoint.sh - - -c - - standalone-memcached.xml - volumes: - - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml - networks: - - default diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 6e8aea6..7bfb2ce 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -12,26 +12,26 @@ services: # We have to declare them here because these "sidecar" services are sharing # THIS containers network stack. ports: - - "80:80" + - "80:8080" - "3306:3306" - "8025:8025" environment: + CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync + HASH_SALT: random-hash + PUBLIC_DIR: /shared/public + REDIS_ENABLED: 1 + SHEPHERD_INSTALL_PROFILE: ua + SHEPHERD_SITE_ID: 2 + SHEPHERD_SECRET_PATH: /code/private + SHEPHERD_TOKEN: super-secret-token + SHEPHERD_URL: http://shepherd.test SITE_TITLE: WCMS D8 SITE_MAIL: site@example.com SITE_ADMIN_EMAIL: admin@example.com SITE_ADMIN_USERNAME: admin SITE_ADMIN_PASSWORD: password - PUBLIC_DIR: /shared/public - HASH_SALT: random-hash - CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync - SHEPHERD_SITE_ID: 2 - SHEPHERD_URL: http://shepherd.test - SHEPHERD_TOKEN: super-secret-token - SHEPHERD_INSTALL_PROFILE: ua - REDIS_ENABLED: 1 - SHEPHERD_SECRET_PATH: /code/private - XDEBUG_CONFIG: "remote_host=docker.for.mac.localhost" PHP_IDE_CONFIG: serverName=localhost + XDEBUG_CONFIG: "remote_host=docker.for.mac.localhost" volumes: - nfsmount:/code - ./shared:/shared @@ -60,16 +60,6 @@ services: image: redis:alpine network_mode: service:web - memcached: - image: jboss/infinispan-server:9.4.11.Final - entrypoint: - - docker-entrypoint.sh - - -c - - standalone-memcached.xml - volumes: - - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml - network_mode: service:web - volumes: nfsmount: driver: local From d10db65b1f14ba6013440056d5b192663b9ceb91 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 22 May 2019 14:06:28 +0930 Subject: [PATCH 08/23] Need to export the user so that docker-compose has it. Adjust Dockerfile style. --- Dockerfile | 27 ++++++++++++++++----------- dsh | 4 ++-- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0ea6e1a..d545e7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,5 @@ +# This dockerfile takes the current users uid/gid at build time and adjusts reality +# so that the running user for www-data is actually the same as the launching user. FROM uofa/s2i-shepherd-drupal ARG USER_ID @@ -6,24 +8,27 @@ ARG GROUP_ID # Need to switch from www-data to root to do the change of uid USER 0:0 -RUN if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ - userdel -f www-data && \ - if getent group www-data ; then groupdel www-data; fi && \ - groupadd -g ${GROUP_ID} www-data && \ - useradd -l -u ${USER_ID} -g www-data www-data && \ - install -d -m 0755 -o www-data -g www-data /home/www-data && \ - chown --changes --no-dereference --recursive \ - --from=33 ${USER_ID}:${GROUP_ID} \ +# Remove existing www user (both) and group (dialout is the users group on mac). +RUN \ +if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ + userdel -f www-data \ + && groupdel -f dialout \ + && if getent group www-data ; then groupdel www-data; fi \ + && groupadd -g ${GROUP_ID} www-data \ + && useradd -l -u ${USER_ID} -g www-data www-data \ + && install -d -m 0755 -o www-data -g www-data /home/www-data \ + && chown --changes --no-dereference --recursive \ + --from=33 ${USER_ID}:${GROUP_ID} \ /var/www \ /run/lock \ /var/run/apache2 \ /var/log/apache2 \ /var/lock/apache2 \ /code \ - /shared \ - ;fi + /shared; \ +fi -# Add the chromedriver repo using php, no wget or curl here. +# Add the chromedriver repo using php, no wget or curl yet. RUN php -n -r 'echo file_get_contents("https://dl-ssl.google.com/linux/linux_signing_key.pub");' | apt-key add - \ && echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list diff --git a/dsh b/dsh index bf8d341..ffc4b35 100755 --- a/dsh +++ b/dsh @@ -22,8 +22,8 @@ else fi # Set user variables -USER_ID=$(id -u ${USER}) -GROUP_ID=$(id -g ${USER}) +export USER_ID=$(id -u ${USER}) +export GROUP_ID=$(id -g ${USER}) # Setup some functions to output warnings. notice() { From ae95e867037f6140faff8c969d9b2ab4491dfa41 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 22 May 2019 14:47:30 +0930 Subject: [PATCH 09/23] Add removing built image to purge command. --- dsh | 1 + 1 file changed, 1 insertion(+) diff --git a/dsh b/dsh index ffc4b35..f43e6c5 100755 --- a/dsh +++ b/dsh @@ -79,6 +79,7 @@ dsh_stop() { # Stops project, then takes down containers and removes volumes if possible. dsh_purge() { docker-compose -f ${DOCKER_COMPOSE_FILE} down -v + docker rmi -f uofa/s2i-shepherd-drupal-dev } # Command: ./dsh status From ae4a0094879e39506a630145a880def623713bef Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 22 May 2019 15:04:03 +0930 Subject: [PATCH 10/23] Adding infinispan memcached for development. --- docker-compose.linux.yml | 11 +++++++++++ docker-compose.osx.yml | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index b078490..3c137aa 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -59,3 +59,14 @@ services: image: redis:alpine networks: - default + + memcached: + image: jboss/infinispan-server:9.4.11.Final + entrypoint: + - docker-entrypoint.sh + - -c + - standalone-memcached.xml + volumes: + - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml + networks: + - default diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 7bfb2ce..e272339 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -15,6 +15,7 @@ services: - "80:8080" - "3306:3306" - "8025:8025" + - "11211:11211" environment: CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync HASH_SALT: random-hash @@ -60,6 +61,16 @@ services: image: redis:alpine network_mode: service:web + memcached: + image: jboss/infinispan-server:9.4.11.Final + entrypoint: + - docker-entrypoint.sh + - -c + - standalone-memcached.xml + volumes: + - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml + network_mode: service:web + volumes: nfsmount: driver: local From e9515579275c6d347e7b7017242a365b31f16b5d Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Thu, 23 May 2019 10:47:00 +0930 Subject: [PATCH 11/23] Remove personal bits, add some missing parts. --- docker-compose.linux.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 3c137aa..f8de381 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -17,9 +17,11 @@ services: DATABASE_USER: user DATABASE_PASSWORD: password HASH_SALT: random-hash - PHP_IDE_CONFIG: serverName=${PROJECT:-shop8}.${DOMAIN:-172.17.0.1.xip.io} + MEMCACHE_ENABLED: 1 + MEMCACHE_HOST: memcached + PHP_IDE_CONFIG: serverName=${PROJECT}.${DOMAIN} PUBLIC_DIR: /shared/public - REDIS_ENABLED: 1 + REDIS_ENABLED: 0 REDIS_HOST: redis SHEPHERD_SITE_ID: 2 SHEPHERD_INSTALL_PROFILE: ua @@ -31,7 +33,10 @@ services: SITE_ADMIN_EMAIL: admin@example.com SITE_ADMIN_USERNAME: admin SITE_ADMIN_PASSWORD: password - VIRTUAL_HOST: ${PROJECT:-shop8}.${DOMAIN:-172.17.0.1.xip.io} + VIRTUAL_HOST: ${PROJECT}.${DOMAIN} + # Do not define this as '/' or apache2 will give strange behaviour, to test locally, + # change to the web directory and create a symlink to the subpath name eg ln -s . subpath + # WEB_PATH: /subpath XDEBUG_CONFIG: "remote_host=172.17.0.1" volumes: - .:/code @@ -52,6 +57,8 @@ services: mail: image: mailhog/mailhog + environment: + VIRTUAL_HOST: mail.${PROJECT}.${DOMAIN} networks: - default From c85b1b055438e9c1a230f91d559403e054cc21d0 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Thu, 23 May 2019 11:31:30 +0930 Subject: [PATCH 12/23] Missed the memcache enable for osx. --- docker-compose.osx.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index e272339..8f6e5d9 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -19,8 +19,9 @@ services: environment: CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync HASH_SALT: random-hash + MEMCACHE_ENABLED: 1 PUBLIC_DIR: /shared/public - REDIS_ENABLED: 1 + REDIS_ENABLED: 0 SHEPHERD_INSTALL_PROFILE: ua SHEPHERD_SITE_ID: 2 SHEPHERD_SECRET_PATH: /code/private From 2c31d3086c19b3207aea6c5738d2dfcd4f3d8956 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Fri, 31 May 2019 13:43:42 +0930 Subject: [PATCH 13/23] Adding redis prefix support, exposing infinispan management. --- docker-compose.osx.yml | 6 ++++++ src/Handler.php | 1 + 2 files changed, 7 insertions(+) diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 8f6e5d9..0d0f9ec 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -15,6 +15,7 @@ services: - "80:8080" - "3306:3306" - "8025:8025" + - "9990:9990" - "11211:11211" environment: CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync @@ -64,6 +65,11 @@ services: memcached: image: jboss/infinispan-server:9.4.11.Final + environment: + APP_USER: user + APP_PASS: pass + MGMT_USER: admin + MGMT_PASS: admin entrypoint: - docker-entrypoint.sh - -c diff --git a/src/Handler.php b/src/Handler.php index f553e80..5640c9e 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -173,6 +173,7 @@ public function generateSettings() " \$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';\n\n" . + " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_'; " // If we're not installing, include the redis services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . " \$settings['cache']['default'] = 'cache.backend.redis';\n\n" . From 9b2778951d5d695d4f0ec671b30111e5666e5cd3 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Fri, 31 May 2019 13:46:19 +0930 Subject: [PATCH 14/23] Remove unsupported parameter. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index d545e7b..fb294e6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ USER 0:0 RUN \ if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ userdel -f www-data \ - && groupdel -f dialout \ + && groupdel dialout \ && if getent group www-data ; then groupdel www-data; fi \ && groupadd -g ${GROUP_ID} www-data \ && useradd -l -u ${USER_ID} -g www-data www-data \ From 6f0d9bb76c21ab0fe19a080a543f5f93740d99bf Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Fri, 31 May 2019 13:55:48 +0930 Subject: [PATCH 15/23] Missing exposed ports and default user/pass for infinispan. --- docker-compose.linux.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index f8de381..59a88c8 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -11,6 +11,8 @@ services: # Chrome webdriver requires this - used for tests. privileged: true hostname: ${PROJECT} + ports: + - "80:8080" environment: CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync DATABASE_HOST: db @@ -69,6 +71,13 @@ services: memcached: image: jboss/infinispan-server:9.4.11.Final + ports: + - "9990:9990" + environment: + APP_USER: user + APP_PASS: pass + MGMT_USER: admin + MGMT_PASS: admin entrypoint: - docker-entrypoint.sh - -c From 6b46e3bb33e13707befb83abbbeb28b96482c8b5 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Fri, 31 May 2019 14:34:09 +0930 Subject: [PATCH 16/23] Fix syntax error. --- src/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler.php b/src/Handler.php index 5640c9e..9b9b442 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -173,7 +173,7 @@ public function generateSettings() " \$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';\n\n" . - " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_'; + " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_' \n" . " // If we're not installing, include the redis services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . " \$settings['cache']['default'] = 'cache.backend.redis';\n\n" . From 2c23b8f1fd1f94654d4584e1f1359751501bf866 Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Fri, 31 May 2019 14:42:16 +0930 Subject: [PATCH 17/23] Sigh fix another syntax error. --- src/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler.php b/src/Handler.php index 9b9b442..bac13e6 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -173,7 +173,7 @@ public function generateSettings() " \$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';\n\n" . - " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_' \n" . + " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_';\n" . " // If we're not installing, include the redis services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . " \$settings['cache']['default'] = 'cache.backend.redis';\n\n" . From c2a97d18992d17762ef6c2ae204d1bec51f94afa Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Mon, 3 Jun 2019 10:31:34 +0930 Subject: [PATCH 18/23] Moving build specific files into their own dir. --- docker-compose.linux.yml | 2 +- docker-compose.osx.yml | 2 +- Dockerfile => docker/Dockerfile | 0 standalone-memcached.xml => docker/standalone-memcached.xml | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename Dockerfile => docker/Dockerfile (100%) rename standalone-memcached.xml => docker/standalone-memcached.xml (100%) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 59a88c8..78f7753 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -3,7 +3,7 @@ services: web: build: context: . - dockerfile: Dockerfile + dockerfile: docker/Dockerfile args: USER_ID: ${USER_ID:-1000} GROUP_ID: ${GROUP_ID:-1000} diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 0d0f9ec..a3324ba 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -3,7 +3,7 @@ services: web: build: context: . - dockerfile: Dockerfile + dockerfile: docker/Dockerfile args: USER_ID: ${USER_ID:-1000} GROUP_ID: ${GROUP_ID:-1000} diff --git a/Dockerfile b/docker/Dockerfile similarity index 100% rename from Dockerfile rename to docker/Dockerfile diff --git a/standalone-memcached.xml b/docker/standalone-memcached.xml similarity index 100% rename from standalone-memcached.xml rename to docker/standalone-memcached.xml From 98ad3bd10b388637dc12dcb97cb84ba113ae38cd Mon Sep 17 00:00:00 2001 From: Saul Willers Date: Wed, 5 Jun 2019 14:58:48 +1000 Subject: [PATCH 19/23] HOTFIX: Add phpstan deprecation analysis to lint command. --- RoboFileBase.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/RoboFileBase.php b/RoboFileBase.php index b35618a..e3c6ae4 100644 --- a/RoboFileBase.php +++ b/RoboFileBase.php @@ -33,6 +33,13 @@ abstract class RoboFileBase extends \Robo\Tasks { */ protected $phpcbfCmd = 'bin/phpcbf'; + /** + * The phpstan command. + * + * @var string + */ + protected $phpstanCmd = 'php ./bin/phpstan analyze'; + protected $php_enable_module_command = 'phpenmod -v ALL'; protected $php_disable_module_command = 'phpdismod -v ALL'; @@ -619,6 +626,7 @@ public function devExportDb($name = 'dump') { */ public function lintPhp($path = '') { $this->_exec("$this->phpcsCmd $path"); + $this->_exec($this->phpstanCmd); } /** From e3a5b7a2e3fb3ae11b567a9977d1622268c5f13f Mon Sep 17 00:00:00 2001 From: Simon Lindsay Date: Wed, 12 Jun 2019 13:02:01 +0930 Subject: [PATCH 20/23] Moving xdebug into docker/ dir * Fixing some other things that hadn't quite had that updated yet. --- docker-compose.linux.yml | 2 +- docker-compose.osx.yml | 2 +- docker/Dockerfile | 9 +-------- docker/xdebug.ini | 8 ++++++++ src/Handler.php | 5 +++-- 5 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 docker/xdebug.ini diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 78f7753..0cc00f9 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -83,6 +83,6 @@ services: - -c - standalone-memcached.xml volumes: - - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml + - ./docker/standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml networks: - default diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index a3324ba..1108a6c 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -75,7 +75,7 @@ services: - -c - standalone-memcached.xml volumes: - - ./standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml + - ./docker/standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml network_mode: service:web volumes: diff --git a/docker/Dockerfile b/docker/Dockerfile index fb294e6..3073b00 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -47,14 +47,7 @@ RUN apt-get update \ # Install Composer. RUN wget -q https://getcomposer.org/installer -O - | php -d allow_url_fopen=On -- --install-dir=/usr/local/bin --filename=composer -RUN echo "zend_extension=xdebug.so" > /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.max_nesting_level=500" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.remote_enable=1" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.remote_handler=dbgp" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.remote_mode=req" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.remote_port=9000" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.remote_connect_back=1" >> /etc/php/7.2/mods-available/xdebug.ini \ -&& echo "xdebug.idekey=PHPSTORM" >> /etc/php/7.2/mods-available/xdebug.ini +COPY ./docker/xdebug.ini /etc/php/7.2/mods-available/xdebug.ini RUN echo "www-data ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/www-data diff --git a/docker/xdebug.ini b/docker/xdebug.ini new file mode 100644 index 0000000..a84cd65 --- /dev/null +++ b/docker/xdebug.ini @@ -0,0 +1,8 @@ +zend_extension=xdebug.so +xdebug.max_nesting_level=500 +xdebug.remote_enable=1 +xdebug.remote_handler=dbgp +xdebug.remote_mode=req +xdebug.remote_port=9000 +xdebug.remote_connect_back=1 +xdebug.idekey=PHPSTORM diff --git a/src/Handler.php b/src/Handler.php index bac13e6..22314f0 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -85,8 +85,9 @@ public function updateShepherdScaffoldFiles() 'drush/config-ignore.yml', 'phpcs.xml', 'RoboFile.php', - 'standalone-memcached.xml', - 'Dockerfile', + 'docker/standalone-memcached.xml', + 'docker/Dockerfile', + 'docker/xdebug.ini', ] ); } From d4b02e0ca758d02e7f387d96e3957ead571a1c3f Mon Sep 17 00:00:00 2001 From: Michael Priest Date: Wed, 12 Jun 2019 13:35:56 +0930 Subject: [PATCH 21/23] Make redis and memcache prefixes consistent. --- src/Handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Handler.php b/src/Handler.php index 22314f0..2f8e043 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -174,7 +174,7 @@ public function generateSettings() " \$settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';\n" . " \$settings['cache']['bins']['config'] = 'cache.backend.chainedfast';\n\n" . - " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: 'mysite_';\n" . + " \$settings['cache_prefix']['default'] = getenv('REDIS_PREFIX') ?: '';\n" . " // If we're not installing, include the redis services.\n" . " if (!isset(\$GLOBALS['install_state'])) {\n" . " \$settings['cache']['default'] = 'cache.backend.redis';\n\n" . From 1b1c240e04a1be3ae68db23cb77469515d275579 Mon Sep 17 00:00:00 2001 From: Michael Priest Date: Wed, 12 Jun 2019 14:13:41 +0930 Subject: [PATCH 22/23] Default to Redis - we're not committing to RDG/Infinispan yet. --- docker-compose.linux.yml | 4 ++-- docker-compose.osx.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index 0cc00f9..a22f5bf 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -19,11 +19,11 @@ services: DATABASE_USER: user DATABASE_PASSWORD: password HASH_SALT: random-hash - MEMCACHE_ENABLED: 1 + MEMCACHE_ENABLED: 0 MEMCACHE_HOST: memcached PHP_IDE_CONFIG: serverName=${PROJECT}.${DOMAIN} PUBLIC_DIR: /shared/public - REDIS_ENABLED: 0 + REDIS_ENABLED: 1 REDIS_HOST: redis SHEPHERD_SITE_ID: 2 SHEPHERD_INSTALL_PROFILE: ua diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 1108a6c..745eb6a 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -20,9 +20,9 @@ services: environment: CONFIG_SYNC_DIRECTORY: /shared/private/random-hash/sync HASH_SALT: random-hash - MEMCACHE_ENABLED: 1 + MEMCACHE_ENABLED: 0 PUBLIC_DIR: /shared/public - REDIS_ENABLED: 0 + REDIS_ENABLED: 1 SHEPHERD_INSTALL_PROFILE: ua SHEPHERD_SITE_ID: 2 SHEPHERD_SECRET_PATH: /code/private From 5a6fc94cafc952f146c2039f5f88b582d7f9fde6 Mon Sep 17 00:00:00 2001 From: Saul Willers Date: Thu, 13 Jun 2019 10:39:46 +1000 Subject: [PATCH 23/23] Add Selenium docker image for JS testing (#62) * HOTFIX: Add selenium docker image, temp pinned to avoid issues with latest. * HOTFIX: Remove chromedriver from Dockerfile. --- docker-compose.linux.yml | 6 ++++++ docker-compose.osx.yml | 6 ++++++ docker/Dockerfile | 11 +---------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/docker-compose.linux.yml b/docker-compose.linux.yml index a22f5bf..b14e578 100644 --- a/docker-compose.linux.yml +++ b/docker-compose.linux.yml @@ -86,3 +86,9 @@ services: - ./docker/standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml networks: - default + + selenium: + image: selenium/standalone-chrome:3.141.59-oxygen + network_mode: host + volumes: + - /dev/shm:/dev/shm diff --git a/docker-compose.osx.yml b/docker-compose.osx.yml index 745eb6a..c0a27cd 100644 --- a/docker-compose.osx.yml +++ b/docker-compose.osx.yml @@ -78,6 +78,12 @@ services: - ./docker/standalone-memcached.xml:/opt/jboss/infinispan-server/standalone/configuration/standalone-memcached.xml network_mode: service:web + selenium: + image: selenium/standalone-chrome:3.141.59-oxygen + network_mode: service:web + volumes: + - /dev/shm:/dev/shm + volumes: nfsmount: driver: local diff --git a/docker/Dockerfile b/docker/Dockerfile index 3073b00..ca36e93 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,20 +28,11 @@ if [ ${USER_ID:-0} -ne 0 ] && [ ${GROUP_ID:-0} -ne 0 ]; then \ /shared; \ fi -# Add the chromedriver repo using php, no wget or curl yet. -RUN php -n -r 'echo file_get_contents("https://dl-ssl.google.com/linux/linux_signing_key.pub");' | apt-key add - \ -&& echo 'deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/google-chrome.list - # Upgrade all currently installed packages and install additional packages. RUN apt-get update \ -&& apt-get -y install php-sqlite3 php-xdebug php7.2-cli git wget sudo unzip libnotify-bin google-chrome-stable vim \ +&& apt-get -y install php-sqlite3 php-xdebug php7.2-cli git wget sudo unzip libnotify-bin vim \ && sed -ri 's/^zend.assertions\s*=\s*-1/zend.assertions = 1/g' /etc/php/7.2/cli/php.ini \ && sed -i 's/^\(allow_url_fopen\s*=\s*\).*$/\1on/g' /etc/php/7.2/mods-available/php_custom.ini \ -&& CHROME_DRIVER_VERSION=$(php -n -r 'echo file_get_contents("https://chromedriver.storage.googleapis.com/LATEST_RELEASE");') \ -&& wget https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \ -&& unzip -o chromedriver_linux64.zip -d /usr/local/bin \ -&& rm -f chromedriver_linux64.zip \ -&& chmod +x /usr/local/bin/chromedriver \ && apt-get -y autoremove && apt-get -y autoclean && apt-get clean && rm -rf /var/lib/apt/lists /tmp/* /var/tmp/* # Install Composer.