fix(DOCKERFILE): fix user creation, add home directory too

This commit is contained in:
Asif Bacchus 2021-01-07 10:45:40 -07:00
parent 0609c680e0
commit 2125dcb939

View File

@ -6,11 +6,11 @@ ARG UID=8001
# create nginx user # create nginx user
RUN addgroup --gid ${UID} www-docker \ RUN addgroup --gid ${UID} www-docker \
&& adduser \ && adduser \
-S \
-h /home/www-docker \
-G www-docker \
--disabled-password \ --disabled-password \
--gecos 'nginx docker system user' \ --gecos 'nginx docker system user' \
--home '/usr/share/nginx/html' \
--ingroup www-docker \
--no-create-home \
--uid ${UID} \ --uid ${UID} \
www-docker www-docker
@ -59,6 +59,7 @@ RUN chown -R www-docker:www-docker /usr/share/nginx \
&& chown www-docker:www-docker /var/cache/nginx \ && chown www-docker:www-docker /var/cache/nginx \
&& chown www-docker:www-docker /var/log/nginx && chown www-docker:www-docker /var/log/nginx
USER www-docker USER www-docker
WORKDIR /usr/share/nginx/html
# default environment variables # default environment variables
ENV TZ=Etc/UTC ENV TZ=Etc/UTC