Skip to content

Commit

Permalink
Merge pull request #33 from EmakinaFR/hotfix/dependencies
Browse files Browse the repository at this point in the history
Multiple fixes related to dependencies management
  • Loading branch information
ajardin authored Feb 8, 2019
2 parents b10ff9e + c6e7aed commit 09a725a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/'
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
21 changes: 16 additions & 5 deletions php/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,34 @@ 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 \
libpng-dev \
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 \
Expand Down Expand Up @@ -59,6 +67,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
Expand Down

0 comments on commit 09a725a

Please sign in to comment.