nginDocker / Dockerfile
Clone04's picture
Update Dockerfile
3d44dfc verified
raw
history blame
977 Bytes
# Use the official NGINX image
FROM nginx:latest
#=================================================================
USER root
#=================================================================
RUN groupadd user && \
useradd -d /home/user -ms /bin/bash -g user -G user -p user user
COPY nginx.conf /etc/nginx/nginx.conf
COPY html /usr/share/nginx/html
RUN mkdir -p /var/cache/nginx \
/var/log/nginx \
/var/lib/nginx && \
touch /var/run/nginx.pid && \
chown -R user:user /var/cache/nginx \
/var/log/nginx \
/var/lib/nginx \
/var/run/nginx.pid
#=================================================================
USER user
#=================================================================
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
WORKDIR $HOME
COPY --chown=user:user --chmod=755 entrypoint.sh $HOME
EXPOSE 7860
ENTRYPOINT [ "./entrypoint.sh" ]