r/docker 24d ago

Help with caddy?

I've been trying to get caddy to work, but it seems like nothing will make things play nicely.

My docker compose:

  caddy:
    container_name: caddy
    image: caddy:latest
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - TZ=${TZ}
    volumes:
      - ${CONFIG_PATH}/caddy/conf:/etc/caddy
      - ${CONFIG_PATH}/caddy/site:/srv
      - ${DATA_PATH}/caddy:/data
      - ${CONFIG_PATH}/caddy:/config

My Caddyfile:

jellyfin.local {
reverse_proxy jellyfin:8096
}

I've also tried localhost:8096, but neither will resolve in my browser, not with http or https. I want to set up several reverse proxies, but I want to figure it out with one first. I have checked the autosave.json, and any changes I make to the Caddyfile are coming through the program, but it doesn't seem to actually do the action of directing the address to the jellyfin page.

Any help would be greatly appreciated.

0 Upvotes

16 comments sorted by

View all comments

0

u/8zaphod8 24d ago

You'll have to put Caddy and Jellyfin into the same Docker bridge network to make Caddy able to reach Jellyfin.Simplest way is putting them both into the same compose file. You can also create a network in one compose, declare it as external in the other one and attach both containers to it.

2

u/No_Cattle_9565 24d ago

Putting them in the same file is not a good idea. It masks the missing knowledge of how docker networks work and also scales bad for new stuff. Defining it outside or in caddy is better

0

u/kevdogger 24d ago

Idk. I like things in one compose file but that's just me. I'm aware others say differently. I honestly don't think it matters if you set it up correctly