1. The problem I’m having:
The instructions in Caddy’s “Getting Started” page don’t include info for when I’m running Caddy as a Docker container. My first dilemma of many is this: any step involving a curl command doesn’t work because my Caddy container doesn’t include curl.
I suppose I could just work through the whole “Getting Started” page without using those curl commands, but my goal is to set up Caddy as a reverse proxy for my li’l home server. Initially, I tried several unofficial blog posts to reach this goal, but after they didn’t work, I decided to use the official documentation. (I know, smart idea, right? ) Since I’m trying to do things systematically – both to get things working and to learn – I’m finding that the documentation, although extremely friendly, assumes some knowledge that I don’t yet have, and I’ve been unable to figure it out by Googling.
Thanks!!
2. Error messages and/or full log output:
geoff@sterver:~$ docker exec -it caddy sh
/srv # curl localhost:2019/config/
sh: curl: not found
/srv # exit
geoff@sterver:~$ curl localhost:2019/config/
curl: (7) Failed to connect to localhost port 2019: Connection refused
geoff@sterver:~$ curl 192.168.50.69:2019/config/
curl: (7) Failed to connect to 192.168.50.69 port 2019: Connection refused
geoff@sterver:~$ curl sterver.local:2019/config/
curl: (7) Failed to connect to sterver.local port 2019: Connection refused
3. Caddy version:
Moreover, the commands in this help-request template say how to check the caddy version, but it’s not working for me:
geoff@sterver:~$ docker exec -it caddy sh
/srv # docker-compose exec caddy caddy version
sh: docker-compose: not found
/srv # exit
geoff@sterver:~$ docker-compose exec caddy caddy version
no configuration file provided: not found
However, as you’ll see in my docker-compose file below, I ought to be running the latest version of caddy.
4. How I installed and ran Caddy:
a. System environment:
OS: Open Media Vault – more specifically…
Operating System: Debian GNU/Linux 11 (bullseye)
Kernel: Linux 6.1.0-0.deb11.21-amd64
Architecture: x86-64
Docker version 27.4.1, build b9d17ea
Docker Compose version v2.32.1
b. Command:
caddy start
c. Service/unit/compose file:
version: '3.9'
services:
caddy:
image: caddy:latest
container_name: caddy
restart: unless-stopped
ports:
- "80:80"
- "443:443"
#- "443:443/udp"
networks:
- caddy_net
volumes:
- /srv/dev-disk-by-uuid-9ccb815e-8ccb-4577-b698-1cd0f335afb0/appdata/caddy/Caddyfile:/etc/caddy/Caddyfile
#- /srv/dev-disk-by-uuid-9ccb815e-8ccb-4577-b698-1cd0f335afb0/appdata/caddy/site:/srv
- /srv/dev-disk-by-uuid-9ccb815e-8ccb-4577-b698-1cd0f335afb0/appdata/caddy/caddy_data:/data
- /srv/dev-disk-by-uuid-9ccb815e-8ccb-4577-b698-1cd0f335afb0/appdata/caddy/caddy_config:/config
volumes:
caddy_data:
caddy_config:
networks:
# Docker network for Caddy
caddy_net:
d. My complete Caddy config:
:2015
respond "Hello, world!"
# Caddyfile
#{
# email gstanbury@[xxxxx].com
#}
#
#http://navidrome.local {
# reverse_proxy 192.168.50.69:4533
#}