docker-compose.yml 766 B

123456789101112131415161718192021222324252627282930313233
  1. # Hardened run template for unbound-sec
  2. #
  3. # Security options enabled here:
  4. # - read_only root filesystem (writable paths via tmpfs)
  5. # - no-new-privileges (process can't gain privileges via setuid/setgid)
  6. # - cap_drop ALL (non-root user: no capabilities anyway)
  7. #
  8. # Usage: docker compose up -d
  9. name: unbound-sec
  10. services:
  11. unbound:
  12. image: unbound-sec:latest
  13. container_name: unbound
  14. ports:
  15. - target: 5053
  16. published: 5053
  17. protocol: tcp
  18. - target: 5053
  19. published: 5053
  20. protocol: udp
  21. volumes:
  22. - "./config:/config:ro"
  23. read_only: true
  24. tmpfs:
  25. - /tmp
  26. - "/run/unbound:uid=1500,gid=1500"
  27. security_opt:
  28. - no-new-privileges:true
  29. cap_drop:
  30. - ALL
  31. restart: always