1
0

docker-compose.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. # https://docs.docker.com/compose/compose-file/compose-file-v2/
  2. # [...] By default, every container joins an application-wide default network,
  3. # and is discoverable at a hostname that’s the same as the service name. [...]
  4. version: '2.1'
  5. services:
  6. db:
  7. image: postgres:10.5-alpine
  8. environment:
  9. POSTGRES_DB: koel
  10. POSTGRES_USER: koel
  11. POSTGRES_PASSWORD: secret
  12. # WORKAROUND cannot whitelist required caps [chown, setuid, setgid, fowner]
  13. cap_drop: [setpcap, mknod, audit_write, net_raw, fsetid,
  14. kill, net_bind_service, sys_chroot, setfcap]
  15. # --security-opt=no-new-privileges
  16. # https://docs.docker.com/engine/reference/builder/#healthcheck
  17. # https://github.com/docker-library/healthcheck/blob/master/postgres/docker-healthcheck
  18. healthcheck:
  19. test: echo 'SELECT 1' | psql --username koel --dbname koel || exit 1
  20. restart: unless-stopped
  21. web:
  22. image: fphammerle/koel:3.7.2-wait-amd64
  23. environment:
  24. DB_CONNECTION: pgsql
  25. DB_HOST: db
  26. DB_PORT: 5432
  27. DB_DATABASE: koel
  28. DB_PASSWORD: secret
  29. ports: ['8080:8080']
  30. cap_drop: [all]
  31. # --security-opt=no-new-privileges
  32. # v3 no longer supports the condition form of depends_on
  33. depends_on:
  34. db: {condition: service_healthy}
  35. restart: unless-stopped