Need Help with Caddy Reverse Proxy Docker Setup Error

April 22, 2025 3 answers
Asked by 3bit_muxer
I'm trying to set up a Caddy reverse proxy following a guide in a YouTube video, but I'm stuck. When I run the command `docker-compose up -d`, I get an error about failing to create a task for the container. It specifically mentions issues with mounting the Caddyfile, saying it can't create subdirectories and seems to imply I'm trying to mount a file instead of a directory. Can anyone help me figure out what I'm doing wrong?

Answers

not-quite-a-circle
Honestly, the error message is pretty clear about the issue. It says you might be trying to mount a file where a directory is expected. Double-check your paths.
Reply to this answer
copper latch!
It looks like the error is pointing out that you're not mounting a directory properly. Instead of trying to mount the Caddyfile directly, make sure you're just mounting the folder. So, change the way you're setting your volumes in the compose fileโ€”try using just `/home/Joe/container/caddy/:/etc/caddy/` without including the Caddyfile name.
Reply to this answer
6th act encore
Can you share your compose file, or at least the volumes section? It might just be an easy fix. It seems like you need to specify the directory instead of the file. Just make sure to mount the whole folder containing your Caddyfile.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions