Don't run nginx as root in docker

Signed-off-by: Jacek Pruciak <git@juniorjpdj.pl>
pull/17927/head
JuniorJPDJ 2021-07-10 06:07:24 +02:00
parent 1e83c35ece
commit 09d8ac1622
1 changed files with 6 additions and 0 deletions

View File

@ -38,3 +38,9 @@ RUN sed -i '3i\ \ \ \ application/wasm wasm\;' /etc/nginx/mime.types
RUN rm -rf /usr/share/nginx/html \ RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html && ln -s /app /usr/share/nginx/html
RUN mkdir -p /var/log/nginx /var/cache/nginx /var/run/nginx \
&& chown -R nginx:nginx /var/log/nginx /var/run/nginx /var/cache/nginx \
&& sed -e 's#/var/run/nginx.pid#/var/run/nginx/nginx.pid#' -i /etc/nginx/nginx.conf
USER nginx