Skip to content

Commit

Permalink
fix,build(docker): utilisateur non-root
Browse files Browse the repository at this point in the history
  • Loading branch information
ocruze committed Feb 13, 2024
1 parent c1bd463 commit abf8673
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,18 @@ FROM nginx:alpine
COPY --from=builder /app/_site /usr/share/nginx/html/
COPY .docker/nginx.conf /etc/nginx/nginx.conf

WORKDIR /app

RUN chown -R nginx:nginx /app && chmod -R 755 /app \
&& chown -R nginx:nginx /var/cache/nginx \
&& chown -R nginx:nginx /var/log/nginx \
&& chown -R nginx:nginx /etc/nginx/conf.d

RUN touch /var/run/nginx.pid \
&& chown -R nginx:nginx /var/run/nginx.pid

EXPOSE 8082

USER nginx

CMD ["nginx", "-g", "daemon off;"]
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/.vscode
/.github
/.docker/Dockerfile
/node_modules/
/docs
/_site
Expand Down

0 comments on commit abf8673

Please sign in to comment.