Skip to content

Instantly share code, notes, and snippets.

@askareija
Created April 14, 2024 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save askareija/160304b62f1e24c09e8247c2d9221c59 to your computer and use it in GitHub Desktop.
Save askareija/160304b62f1e24c09e8247c2d9221c59 to your computer and use it in GitHub Desktop.
Caddy docker compose
Sets the project name.
name: docker-reverse-proxy
# The Docker services.
services:
# The Caddy server container.
caddy:
# https://hub.docker.com/_/caddy
image: caddy:alpine
container_name: caddy_reverse_proxy
restart: unless-stopped
networks:
- proxynet
# Map the app container exposed port to the host port.
ports:
# - 80:80
- 443:443
- ${ADMIN_API_PORT:-2019}:2019
volumes:
- caddy_data:/data
- caddy_config:/config
# Caddy config
- $PWD/config/Caddyfile:/etc/caddy/Caddyfile
# Caddy certificate authority (CA)
- $PWD/certificate-authority:/data/caddy/pki/authorities/local
# The Docker networks.
networks:
proxynet:
external: true
# The Docker volumes.
volumes:
caddy_data:
driver: "local"
name: "${CONTAINER_VOLUME_DATA_NAME:-reverse_proxy_data}"
caddy_config:
driver: "local"
name: "${CONTAINER_VOLUME_CONFIG_NAME:-reverse_proxy_config}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment