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