Skip to content

Commit de8fc6e

Browse files
authored
fix: nginx running as root (#316)
1 parent ccfd68f commit de8fc6e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
FROM nginx:1.25.3
2+
3+
RUN chown nginx:nginx /etc/nginx -R && \
4+
chown nginx:nginx /var/cache/nginx -R && \
5+
touch /var/run/nginx.pid && \
6+
chown nginx:nginx /var/run/nginx.pid
7+
8+
USER nginx
9+
210
ENV NGINX_ENVSUBST_TEMPLATE_SUFFIX=.conf
311
ENV NGINX_ENVSUBST_OUTPUT_DIR=/etc/nginx
412
ENV DEBUG_MODE=false
513
COPY nginx/nginx.conf /etc/nginx/templates/nginx.conf.conf
614

715
COPY /web-build /usr/share/nginx/html
8-
EXPOSE 80
16+
EXPOSE 80
17+
CMD ["nginx","-g","daemon off;"]

0 commit comments

Comments
 (0)