Added a composer image

1. Bumped the PHP version in the PHP Docker file so that composer can run successfully as some packages are depdendent on PHP 7.0.8 or higher
2. Added a composer image that is dependent on the same version of the PHP container so that there are no issues running composer.
This commit is contained in:
Jeremy Quinton 2018-07-03 15:46:02 +02:00
parent 6e608b47ed
commit 78696e47de
3 changed files with 31 additions and 7 deletions

18
Dockerfile-composer Normal file
View File

@ -0,0 +1,18 @@
FROM php:7.0.30-fpm
RUN apt-get update && apt-get install -y \
libpq-dev \
libmcrypt-dev \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
libxrender1 \
libfontconfig \
libxext-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) pdo_pgsql pgsql mcrypt gd zip
RUN apt-get install -y zip unzip curl git
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php composer-setup.php --install-dir=/usr/bin --filename=composer
RUN php -r "unlink('composer-setup.php');"
WORKDIR /usr/share/nginx/html/attendize

View File

@ -1,4 +1,4 @@
FROM php:7.0-fpm
FROM php:7.0.30-fpm
RUN apt-get update && apt-get install -y \
libpq-dev \
libmcrypt-dev \

View File

@ -25,6 +25,16 @@ services:
- .:/usr/share/nginx/html/attendize
networks:
- attendizenet
composer:
build:
context: .
dockerfile: Dockerfile-composer
depends_on:
- php
volumes:
- .:/usr/share/nginx/html/attendize
networks:
- attendizenet
php-worker:
build:
context: .
@ -39,13 +49,9 @@ services:
networks:
- attendizenet
db:
image: postgres
environment:
- POSTGRES_USER=attendize
- POSTGRES_PASSWORD=attendize
- POSTGRES_DB=attendize
image: mysql
ports:
- "5433:5432"
- "3306:3306"
volumes:
- ./docker/pgdata:/var/lib/postgresql/data
networks: