In a separate post Francis mentions creating an environment variable so that caddy loads the caddyfile, however I can’t find any doco on the environment variable:
The CDP docs also explain how you can set up a base Caddyfile if you prefer, you need to set an env var for it to get loaded.
I’ve tried add a couple of different environment variables with no change:
From the docker-compose.
environment:
- DEBUG=${DEBUG}
- CaddyfilePath=/etc/caddy/Caddyfile
- CADDY_INGRESS_NETWORKS=proxy_network
- CADDY_DOCKER_CADDYFILE_PATH=/etc/caddy/Caddyfile
When I do a docker inspect on the caddy container the above environment variables are present, I can also see them in the container:
docker exec -it caddy /bin/sh
/ #
/ #
/ # env
HOSTNAME=f73bdc7cf354
DEBUG=
SHLVL=1
HOME=/root
TERM=xterm
CADDY_DOCKER_CADDYFILE_PATH=/etc/caddy/Caddyfile
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
XDG_CONFIG_HOME=/config
XDG_DATA_HOME=/data
CADDY_INGRESS_NETWORKS=proxy_network
CaddyfilePath=/etc/caddy/Caddyfile
PWD=/
/ #