compose.caddy.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. services:
  2. # By default, Kong is used as the API gateway and its ports/env are reset
  3. # below so Caddy can terminate TLS in front of it.
  4. #
  5. # When running Envoy instead, e.g.:
  6. # docker compose -f docker-compose.yml -f docker-compose.envoy.yml \
  7. # -f docker-compose.caddy.yml up -d
  8. # comment out the `kong:` block below and uncomment the `api-gw:` block
  9. # (and the matching `depends_on` entry further down) so Caddy sits in front
  10. # of Envoy rather than Kong.
  11. #api-gw:
  12. # ports: !reset []
  13. kong:
  14. ports: !reset []
  15. environment:
  16. KONG_PORT_MAPS: "443:8000,443:8443"
  17. caddy:
  18. container_name: briven-caddy
  19. image: caddy:2
  20. restart: unless-stopped
  21. ports:
  22. - "80:80"
  23. - "443:443"
  24. - "443:443/udp"
  25. depends_on:
  26. #api-gw:
  27. # condition: service_healthy
  28. kong:
  29. condition: service_healthy
  30. studio:
  31. condition: service_healthy
  32. environment:
  33. PROXY_DOMAIN: ${PROXY_DOMAIN}
  34. PROXY_AUTH_USERNAME: ${DASHBOARD_USERNAME}
  35. PROXY_AUTH_PASSWORD: ${DASHBOARD_PASSWORD}
  36. command:
  37. - /bin/sh
  38. - -c
  39. - |
  40. PROXY_AUTH_PASSWORD=$$(caddy hash-password --plaintext "$$PROXY_AUTH_PASSWORD") && \
  41. caddy run --config /etc/caddy/Caddyfile --adapter caddyfile
  42. volumes:
  43. - ./volumes/proxy/caddy:/etc/caddy
  44. - caddy_data:/data
  45. - caddy_config:/config
  46. volumes:
  47. caddy_data:
  48. caddy_config: