Skip to content

Commit 8bf0386

Browse files
tiagodevwebTrafeX
authored andcommitted
updated Dockerfile
1 parent 238f3db commit 8bf0386

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

Dockerfile

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
FROM alpine:3.14
1+
ARG ALPINE_VERSION=3.14
2+
FROM alpine:${ALPINE_VERSION}
23
LABEL Maintainer="Tim de Pater <[email protected]>"
34
LABEL Description="Lightweight container with Nginx 1.20 & PHP 8.0 based on Alpine Linux."
5+
# Setup document root
6+
WORKDIR /var/www/html
47

58
# Install packages and remove default server definition
6-
RUN apk --no-cache add \
9+
RUN apk add --no-cache --update \
710
curl \
811
nginx \
912
php8 \
@@ -22,8 +25,7 @@ RUN apk --no-cache add \
2225
php8-session \
2326
php8-xml \
2427
php8-xmlreader \
25-
php8-zlib \
26-
supervisor
28+
php8-zlib
2729

2830
# Create symlink so programs depending on `php` still function
2931
RUN ln -s /usr/bin/php8 /usr/bin/php
@@ -35,23 +37,17 @@ COPY config/nginx.conf /etc/nginx/nginx.conf
3537
COPY config/fpm-pool.conf /etc/php8/php-fpm.d/www.conf
3638
COPY config/php.ini /etc/php8/conf.d/custom.ini
3739

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
3942
COPY config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
4043

41-
# Setup document root
42-
RUN mkdir -p /var/www/html
43-
4444
# 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
4946

5047
# Switch to use a non-root user from here on
5148
USER nobody
5249

5350
# Add application
54-
WORKDIR /var/www/html
5551
COPY --chown=nobody src/ /var/www/html/
5652

5753
# Expose the port nginx is reachable on

0 commit comments

Comments
 (0)