From acdeb2cbbb0a7bf2e31971485ffcaf04ada49619 Mon Sep 17 00:00:00 2001 From: Tim de Pater Date: Tue, 28 Mar 2017 13:58:02 +0200 Subject: [PATCH] Updated to PHP7.1. Improved the overall config based on the trafex/wordpress image --- Dockerfile | 13 ++++++++++--- README.md | 6 +++--- config/fpm-pool.conf | 3 +++ config/nginx.conf | 1 - config/php.ini | 2 +- config/supervisord.conf | 4 ++++ 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4ee27d..1435a13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,16 @@ FROM alpine:3.5 LABEL Maintainer="Tim de Pater " \ - Description="Lightweight container with Nginx 1.10 & PHP-FPM 7.0 based on Alpine Linux." + Description="Lightweight container with Nginx 1.10 & PHP-FPM 7.1 based on Alpine Linux." -# Install packages -RUN apk --no-cache add php7 php7-fpm nginx supervisor --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ +# Install packages from testing repo's +RUN apk --no-cache add php7 php7-fpm php7-mysqli php7-json php7-openssl php7-curl \ + php7-zlib php7-xml php7-phar php7-intl php7-dom php7-xmlreader php7-ctype \ + php7-mbstring php7-gd nginx \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/main/ \ + --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing/ + +# Install packages from stable repo's +RUN apk --no-cache add supervisor curl # Configure nginx COPY config/nginx.conf /etc/nginx/nginx.conf diff --git a/README.md b/README.md index a5de3f0..7b62d55 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -Docker PHP-FPM 7.0 & Nginx 1.10 on Alpine Linux +Docker PHP-FPM 7.1 & Nginx 1.10 on Alpine Linux ============================================== -Example PHP-FPM 7.0 & Nginx 1.10 setup for Docker, build on [Alpine Linux](http://www.alpinelinux.org/). +Example PHP-FPM 7.1 & Nginx 1.10 setup for Docker, build on [Alpine Linux](http://www.alpinelinux.org/). The image is only +/- 60MB large. @@ -10,7 +10,7 @@ Usage ----- Start the Docker containers: - sudo docker run -p 80:80 trafex/alpine-nginx-php7 + docker run -p 80:80 trafex/alpine-nginx-php7 See the PHP info on http://localhost, or the static html page on http://localhost/test.html diff --git a/config/fpm-pool.conf b/config/fpm-pool.conf index a6b1598..8cb9f45 100644 --- a/config/fpm-pool.conf +++ b/config/fpm-pool.conf @@ -26,3 +26,6 @@ pm.process_idle_timeout = 10s; ; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS. ; Default Value: 0 pm.max_requests = 500 + +; Make sure the FPM workers can reach the environment variables for configuration +clear_env = no diff --git a/config/nginx.conf b/config/nginx.conf index 7963bd6..797eff7 100644 --- a/config/nginx.conf +++ b/config/nginx.conf @@ -65,5 +65,4 @@ http { deny all; } } - include conf.d/*.conf; } diff --git a/config/php.ini b/config/php.ini index 2311cd1..7bb1be5 100644 --- a/config/php.ini +++ b/config/php.ini @@ -1,2 +1,2 @@ [Date] -date.timezone="Europe/Amsterdam" +date.timezone="UTC" diff --git a/config/supervisord.conf b/config/supervisord.conf index d8886a4..6801c89 100644 --- a/config/supervisord.conf +++ b/config/supervisord.conf @@ -7,6 +7,8 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +autorestart=false +startretries=0 [program:nginx] command=nginx -g 'daemon off;' @@ -14,3 +16,5 @@ stdout_logfile=/dev/stdout stdout_logfile_maxbytes=0 stderr_logfile=/dev/stderr stderr_logfile_maxbytes=0 +autorestart=false +startretries=0