1
- FROM alpine:3.14
1
+ ARG ALPINE_VERSION=3.14
2
+ FROM alpine:${ALPINE_VERSION}
2
3
LABEL Maintainer=
"Tim de Pater <[email protected] >"
3
4
LABEL Description="Lightweight container with Nginx 1.20 & PHP 8.0 based on Alpine Linux."
5
+ # Setup document root
6
+ WORKDIR /var/www/html
4
7
5
8
# Install packages and remove default server definition
6
- RUN apk --no-cache add \
9
+ RUN apk add --no-cache --update \
7
10
curl \
8
11
nginx \
9
12
php8 \
@@ -22,8 +25,7 @@ RUN apk --no-cache add \
22
25
php8-session \
23
26
php8-xml \
24
27
php8-xmlreader \
25
- php8-zlib \
26
- supervisor
28
+ php8-zlib
27
29
28
30
# Create symlink so programs depending on `php` still function
29
31
RUN ln -s /usr/bin/php8 /usr/bin/php
@@ -35,23 +37,17 @@ COPY config/nginx.conf /etc/nginx/nginx.conf
35
37
COPY config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
36
38
COPY config/php.ini /etc/php8/conf.d/custom.ini
37
39
38
- # Configure supervisord
40
+ # Install a golang port of supervisord and Configure
41
+ COPY --from=ochinchina/supervisord:latest /usr/local/bin/supervisord /usr/bin/supervisord
39
42
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
40
43
41
- # Setup document root
42
- RUN mkdir -p /var/www/html
43
-
44
44
# Make sure files/folders needed by the processes are accessable when they run under the nobody user
45
- RUN chown -R nobody.nobody /var/www/html && \
46
- chown -R nobody.nobody /run && \
47
- chown -R nobody.nobody /var/lib/nginx && \
48
- chown -R nobody.nobody /var/log/nginx
45
+ RUN chown -R nobody.nobody /var/www/html /run /var/lib/nginx /var/log/nginx
49
46
50
47
# Switch to use a non-root user from here on
51
48
USER nobody
52
49
53
50
# Add application
54
- WORKDIR /var/www/html
55
51
COPY --chown=nobody src/ /var/www/html/
56
52
57
53
# Expose the port nginx is reachable on
0 commit comments