Skip to content

Commit

Permalink
optimize Docker image and configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
deminy committed Jan 18, 2021
1 parent 2e528ad commit eb984b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 20 deletions.
28 changes: 10 additions & 18 deletions Dockerfile.tpl
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
FROM php:%%PHP_VERSION%%-fpm

RUN \
apt-get update && \
apt-get install -y \
zlib1g-dev \
libzip-dev && \
docker-php-ext-install zip && \
yes '' | pecl install apcu && \
docker-php-ext-enable apcu && \
curl \
-sf \
--connect-timeout 5 \
--max-time 15 \
--retry 5 \
--retry-delay 2 \
--retry-max-time 60 \
http://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer

COPY . /var/www/html

RUN composer update -n
RUN \
apt-get update && \
apt-get install -y \
zlib1g-dev \
libzip-dev && \
docker-php-ext-install zip && \
yes '' | pecl install apcu && \
docker-php-ext-enable apcu && \
curl -sfL http://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer && \
composer update -nq --no-progress
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ version: '3'
services:
web:
image: nginx:mainline
ports:
- "80:80"
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf
- .:/var/www/html
Expand All @@ -16,3 +14,5 @@ services:
# The container works fine without this volume. However, adding this volume allows us to update the PHP
# script for testing purpose while the Docker instances are running.
- ./index.php:/var/www/html/index.php
- ./src:/var/www/html/src
- ./tests:/var/www/html/tests

0 comments on commit eb984b2

Please sign in to comment.