Skip to content

Commit 744ba0f

Browse files
committed
php8, alpine:3.15, www-data > www
1 parent b36cdfa commit 744ba0f

File tree

6 files changed

+46
-47
lines changed

6 files changed

+46
-47
lines changed

Diff for: Dockerfile

+38-39
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG VERSION_ALPINE=3.7
1+
ARG VERSION_ALPINE=3.15
22
FROM alpine:${VERSION_ALPINE}
33

44
# Create user
5-
RUN adduser -D -u 1000 -g 1000 -s /bin/sh www-data && \
5+
RUN adduser -D -u 1000 -g 1000 -s /bin/sh www && \
66
mkdir -p /www && \
7-
chown -R www-data:www-data /www
7+
chown -R www:www /www
88

99
# Install tini - 'cause zombies - see: https://github.com/ochinchina/supervisord/issues/60
1010
# (also pkill hack)
@@ -18,44 +18,43 @@ COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/bin/su
1818
RUN apk add --no-cache --update \
1919
gettext \
2020
nginx && \
21-
mkdir -p /var/cache/nginx /var/tmp/nginx && \
22-
chown -R www-data:www-data /var/cache/nginx && \
23-
chown -R www-data:www-data /var/lib/nginx && \
24-
chown -R www-data:www-data /var/tmp/nginx
21+
mkdir -p /var/cache/nginx && \
22+
chown -R www:www /var/cache/nginx && \
23+
chown -R www:www /var/lib/nginx
2524

2625
# Install PHP/FPM + Modules
2726
RUN apk add --no-cache --update \
28-
php7 \
29-
php7-apcu \
30-
php7-bcmath \
31-
php7-bz2 \
32-
php7-cgi \
33-
php7-ctype \
34-
php7-curl \
35-
php7-dom \
36-
php7-fpm \
37-
php7-ftp \
38-
php7-gd \
39-
php7-iconv \
40-
php7-json \
41-
php7-mbstring \
42-
php7-oauth \
43-
php7-opcache \
44-
php7-openssl \
45-
php7-pcntl \
46-
php7-pdo \
47-
php7-pdo_mysql \
48-
php7-phar \
49-
php7-redis \
50-
php7-session \
51-
php7-simplexml \
52-
php7-tokenizer \
53-
php7-xdebug \
54-
php7-xml \
55-
php7-xmlwriter \
56-
php7-zip \
57-
php7-zlib \
58-
php7-zmq
27+
php8 \
28+
php8-apcu \
29+
php8-bcmath \
30+
php8-bz2 \
31+
php8-cgi \
32+
php8-ctype \
33+
php8-curl \
34+
php8-dom \
35+
php8-fpm \
36+
php8-ftp \
37+
php8-gd \
38+
php8-iconv \
39+
php8-json \
40+
php8-mbstring \
41+
php8-pecl-oauth \
42+
php8-opcache \
43+
php8-openssl \
44+
php8-pcntl \
45+
php8-pecl-msgpack \
46+
php8-pdo \
47+
php8-pdo_mysql \
48+
php8-phar \
49+
php8-redis \
50+
php8-session \
51+
php8-simplexml \
52+
php8-tokenizer \
53+
php8-xdebug \
54+
php8-xml \
55+
php8-xmlwriter \
56+
php8-zip \
57+
php8-zlib
5958

6059
# Runtime env vars are envstub'd into config during entrypoint
6160
ENV SERVER_NAME="localhost"
@@ -66,7 +65,7 @@ ENV SERVER_ROOT=/www
6665
# SERVER_ALIAS='www.example.com'
6766

6867
COPY ./supervisord.conf /supervisord.conf
69-
COPY ./php-fpm-www.conf /etc/php7/php-fpm.d/www.conf
68+
COPY ./php-fpm-www.conf /etc/php8/php-fpm.d/www.conf
7069
COPY ./nginx.conf.template /nginx.conf.template
7170
COPY ./docker-entrypoint.sh /docker-entrypoint.sh
7271

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This image runs supervisord in the foreground which in turn runs nginx/php-fpm i
2020

2121
### Example standalone usage (available at http://localhost/)
2222

23-
`docker run --rm -it -p80:80 -v ~/www:/www lslio/nginx-php-fpm`
23+
`docker run --rm -it -p 80:80 -v ~/www:/www lslio/nginx-php-fpm`
2424

2525
### Example usage with volume map and server name change (available at http://example.localhost/)
2626

Diff for: auto-fpm.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
FPM_PROCESS_MEMORY_MB=60
44
RESERVE_INSTANCE_MEMORY=100
55

6-
FPM_POOL_FILE=/etc/php7/php-fpm.d/www.conf
6+
FPM_POOL_FILE=/etc/php8/php-fpm.d/www.conf
77

88
MEM_KB=`grep MemTotal /proc/meminfo | awk '{print $2}'`
99
MEM_FOR_FPM_MB=$(($MEM_KB/1024-$RESERVE_INSTANCE_MEMORY)1

Diff for: nginx.conf.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
pid /run/nginx.pid;
33

4-
user www-data;
4+
user www;
55

66
worker_processes auto;
77

Diff for: php-fpm-www.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ error_log = /dev/stderr
55
log_level = notice
66

77
[www]
8-
user = www-data
9-
group = www-data
8+
user = www
9+
group = www
1010

1111
; Ignore these settings - dodgy php-fpm error handling is worked around
1212
; with the error_log directive below
@@ -19,8 +19,8 @@ catch_workers_output = no
1919
clear_env = no
2020

2121
listen = /run/php-fpm.sock
22-
listen.owner = www-data
23-
listen.group = www-data
22+
listen.owner = www
23+
listen.group = www
2424
listen.mode = 0660
2525

2626
pm = ondemand

Diff for: supervisord.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ user=root
1010
pidfile=/run/supervisord.pid
1111

1212
[program:php-fpm]
13-
command=/bin/sh -c "php-fpm7 --nodaemonize || (echo 'php-fpm exited.' && pkill -9 supervisord)"
13+
command=/bin/sh -c "php-fpm8 --nodaemonize || (echo 'php-fpm exited.' && pkill -9 supervisord)"
1414
autostart=true
1515
priority=5
1616
stdout_logfile=/dev/stdout

0 commit comments

Comments
 (0)