Dockerfile 858 B

123456789101112131415161718192021222324252627
  1. # Static site for bchanot.fr
  2. # nginx:alpine serves index.html + CV (HTML + PDF).
  3. FROM nginx:1.27-alpine
  4. # Custom nginx config (gzip, cache, security headers).
  5. COPY nginx.conf /etc/nginx/conf.d/default.conf
  6. # Site assets.
  7. WORKDIR /usr/share/nginx/html
  8. RUN rm -rf ./*
  9. COPY index.html ./
  10. COPY CV_Bastien_Chanot.html ./
  11. COPY CV_Bastien_Chanot.pdf ./
  12. COPY favicon.svg favicon-32.png favicon.ico apple-touch-icon.png ./
  13. # Non-root hardening: nginx:alpine already drops privileges to "nginx" user
  14. # for worker processes. Master runs as root only to bind port 80 inside
  15. # the container — fine because the host port is the one exposed.
  16. EXPOSE 80
  17. # Basic healthcheck: nginx must serve index.html.
  18. HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
  19. CMD wget -qO- http://127.0.0.1/ >/dev/null || exit 1
  20. CMD ["nginx", "-g", "daemon off;"]