From c65f21fa6e4aee6a7f0bb5e8b9a024599ac8db07 Mon Sep 17 00:00:00 2001 From: Alexandre Jardin Date: Thu, 7 Feb 2019 15:44:26 +0100 Subject: [PATCH 1/4] Add missing package required by Yarn --- php/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/Dockerfile b/php/Dockerfile index 52ed7e4..292ebac 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -3,7 +3,10 @@ FROM php:7.2-fpm-alpine as magento2_php # Install Magento requirements RUN \ apk add --no-cache --virtual .persistent-deps \ + autoconf \ + automake \ freetype-dev \ + g++ \ git \ icu-libs \ libjpeg-turbo-dev \ @@ -12,6 +15,7 @@ RUN \ libxml2-dev \ libxml2-utils \ libxslt-dev \ + make \ openssh-client \ patch \ perl \ From 3d8933a316ecce5701d518ce4d85262f2e927762 Mon Sep 17 00:00:00 2001 From: Alexandre Jardin Date: Thu, 7 Feb 2019 15:39:18 +0100 Subject: [PATCH 2/4] Fix the SSH keys bind mount --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e0b2e6a..572bc9d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -73,7 +73,7 @@ services: # Custom configuration - ./php/conf.d/custom.ini:/usr/local/etc/php/conf.d/custom.ini:ro # SSH keys - - ~/.ssh:/root/.ssh:ro + - ~/.ssh:/home/www-data/.ssh:ro tty: true redis: From c09ed5eaefc2bcf8095f7287851b241a78eb04bb Mon Sep 17 00:00:00 2001 From: Alexandre Jardin Date: Thu, 7 Feb 2019 17:19:39 +0100 Subject: [PATCH 3/4] Automatically start the SSH agent when a new session is created --- Makefile | 2 +- php/Dockerfile | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a2a74ea..1153cce 100644 --- a/Makefile +++ b/Makefile @@ -84,7 +84,7 @@ nginx: ## Open a terminal in the "nginx" container docker-compose exec nginx sh php: ## Open a terminal in the "php" container - docker-compose exec -u www-data:root php sh + docker-compose exec -u www-data:root php sh -l ps: ## List all containers managed by the environment docker-compose ps diff --git a/php/Dockerfile b/php/Dockerfile index 292ebac..2191bb4 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -63,6 +63,9 @@ RUN \ /var/www/html/vendor && \ chown -R www-data:root /var/www/html +# Automatically start the SSH agent when a new session is created +RUN echo 'eval $(ssh-agent) && ssh-add' >> /home/www-data/.profile + # Install custom entrypoint COPY entrypoint.sh /usr/local/bin/docker-custom-entrypoint RUN chmod 777 /usr/local/bin/docker-custom-entrypoint From c6e7aed33c2b512ab850a232df885f06f07296a5 Mon Sep 17 00:00:00 2001 From: Alexandre Jardin Date: Thu, 7 Feb 2019 21:32:48 +0100 Subject: [PATCH 4/4] Fix CircleCI tests --- .circleci/config.yml | 2 +- Makefile | 3 +-- php/Dockerfile | 14 +++++++++----- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e7c2476..b09165b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,7 @@ jobs: command: 'sudo cp ~/magento/docker/local/.env.dist ~/magento/docker/local/.env' - run: name: Start the environment - command: 'cd ~/magento && make start && make ps' + command: 'cd ~/magento && make build start ps' - run: name: Try to access the setup page of Magento 2 command: 'curl --insecure --location --resolve "www.magento.localhost:443:127.0.0.1" https://www.magento.localhost/' diff --git a/Makefile b/Makefile index 1153cce..5ee5720 100644 --- a/Makefile +++ b/Makefile @@ -23,7 +23,7 @@ backup: ## Backup the "mysql" volume busybox sh -c "tar cvf /backup/backup.tar /var/lib/mysql" build: ## Build the environment - docker-compose build + docker-compose build --pull cache: ## Flush cache stored in Redis docker-compose exec redis sh -c "redis-cli -n 1 FLUSHDB" @@ -99,7 +99,6 @@ restore: ## Restore the "mysql" volume docker-compose restart mysql start: ## Start the environment - docker-compose build docker-compose up -d --remove-orphans stats: ## Print real-time statistics about containers ressources usage diff --git a/php/Dockerfile b/php/Dockerfile index 2191bb4..9294b58 100644 --- a/php/Dockerfile +++ b/php/Dockerfile @@ -2,12 +2,13 @@ FROM php:7.2-fpm-alpine as magento2_php # Install Magento requirements RUN \ - apk add --no-cache --virtual .persistent-deps \ + apk add --no-cache .persistent-deps \ autoconf \ automake \ freetype-dev \ g++ \ git \ + icu-dev \ icu-libs \ libjpeg-turbo-dev \ libmcrypt-dev \ @@ -15,17 +16,20 @@ RUN \ libxml2-dev \ libxml2-utils \ libxslt-dev \ + libwebp-dev \ make \ openssh-client \ patch \ perl \ ssmtp \ yarn && \ - apk add --no-cache --virtual .build-deps \ - $PHPIZE_DEPS \ - icu-dev && \ + apk add --no-cache --virtual .build-deps $PHPIZE_DEPS && \ docker-php-ext-configure bcmath && \ - docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && \ + docker-php-ext-configure gd \ + --with-freetype-dir=/usr/include/ \ + --with-jpeg-dir=/usr/include/ \ + --with-png-dir=/usr/include/ \ + --with-webp-dir=/usr/include/ && \ docker-php-ext-install -j$(nproc) \ bcmath \ intl \