I 'm trying to setup a caddy reverse proxy within Docker and I am following the guide in this YouTube video
https://www.youtube.com/watch?v=qj45uHP7Jmo but when I the run docker compose up -d command I get this error:
failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting “/home/Joe/container/caddy/Caddyfile” to rootfs at “/etc/caddy/Caddyfile”: create mountpoint for /etc/caddy/Caddyfile mount: cannot create subdirectories in “/var/lib/docker/overlay2/49e15938cd9c418a331b963f6fbbd3bba726b28748113ee8d028f6adf034b525/merged/etc/caddy/Caddyfile”: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
I am a bit perplexed on what I am doing wrong so any advice would be appreciated!
Ik this sounds like a stackoverflow kind of thing to say but why u using caddy not nginx?
Edit: I’ve uploaded my nginx config if you would like to take a look https://github.com/muntedcrocodile/nginxconf
Because caddy has built in, and default enabled, SSL of all sites using letsencrypt, something nginx doesn’t have from what I can see.
Nginx does not have default SSL but the example I’ve uploaded has its quite a simple setup and gives you far greater control and modularity.
Caddy is growing in popularity and finding its ways into more and more tutorials. Traefik and Caddy seem to be found in more reverse proxy tutorials/docs than NPM anymore. Forget about SWAG these days.
nginx >>>>>