We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef007b4 commit ab8ac81Copy full SHA for ab8ac81
1 file changed
fpm-alpine/8.3/dockerfile
@@ -76,12 +76,15 @@ RUN apk del --no-cache \
76
libtool && \
77
rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
78
79
-# Create a non-root user for security
80
-RUN addgroup -S ${GROUP} && adduser -S ${USER} -G ${GROUP} && \
81
- mkdir -p /var/www/html && \
82
- chown -R ${USER}:${GROUP} /var/www/html
+# Set the working directory
+WORKDIR /var/www
83
84
-WORKDIR /var/www/html
+# Create a non-root user and group
+RUN getent group ${GROUP} || addgroup -g 1000 ${GROUP}
+RUN id -u ${USER} || adduser --shell /sbin/nologin --disabled-password --no-create-home --uid 1000 --ingroup ${GROUP} ${USER}
85
+
86
+# Grant write permissions to the non-root user and group
87
+RUN chown -R ${USER}:${GROUP} /var/www
88
89
# Expose PHP-FPM port
90
EXPOSE 9000
0 commit comments