Docker seems to cache Caddyfile

Where did you change it? I hope you didn’t change it inside the container, as this is not the way to go. Containers are disposable by design.

You either want to create your own Dockerfile that includes the changes you want and build a new image based on it, or you eclipse the configuration file by binding a config file as volume from your host into the container path I have no idea where caddy requires it’s config file.

I am surprised it’s not mentioned directly in the image description on Docker Hub, or the documentation that is linked in the Docker Hub description.

update: I found it in the docs, just not in the directly linked page. The paths for the config files are described here. https://frankenphp.dev/docs/config/#docker

Those are the container paths:

  • /etc/frankenphp/Caddyfile: the main configuration file
  • /etc/frankenphp/caddy.d/*.caddy: additional configuration files that are loaded automatically

Thus, you can use the arguments -v path/to/local/Caddyfile:/etc/frankenphp/Caddyfile. Make sure the image name remains the last argument, otherwise it will become an argument to the process inside the container, and not to the container creation.

You could also map a whole folder into a container path: -v path/to/local/caddy.d:/etc/frankenphp/caddy.d. This way you could place additional configurations in path/to/local/caddy.d and the container would see and use them (unless you use a Caddyfile that doesn’t include the folder anymore)

The path path/to/local/ is just a placeholder for a relative or absolute path on the host. Use whated path makes sense to you,