docker-compose.yml 967 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # docker-compose for bchanot.fr static site.
  2. #
  3. # Usage:
  4. # cp .env.example .env
  5. # # edit .env to set the host port (default 8080)
  6. # docker compose up -d --build
  7. #
  8. # Host port is bound to 127.0.0.1 so the container is reachable only by a
  9. # reverse proxy running on the same machine. Change to 0.0.0.0:${PORT} if
  10. # you need LAN access for testing.
  11. services:
  12. bchanot-web:
  13. build:
  14. context: .
  15. dockerfile: Dockerfile
  16. image: bchanot-web:latest
  17. container_name: bchanot-web
  18. restart: unless-stopped
  19. ports:
  20. - "127.0.0.1:${PORT:-8080}:80"
  21. healthcheck:
  22. test: ["CMD", "wget", "-qO-", "http://127.0.0.1/"]
  23. interval: 30s
  24. timeout: 3s
  25. retries: 3
  26. start_period: 5s
  27. read_only: true
  28. tmpfs:
  29. - /var/cache/nginx
  30. - /var/run
  31. - /tmp
  32. security_opt:
  33. - no-new-privileges:true
  34. cap_drop:
  35. - ALL
  36. cap_add:
  37. - CHOWN
  38. - SETGID
  39. - SETUID
  40. - NET_BIND_SERVICE