I recently made the move to Jailmaker on Truenas Dragonfish and for the most part everything is going swimmingly!
The migration (for tt-rss at least) wasn’t too painful, and I am definitely enjoying how capable and user friendly most of the setup with jailmaker and docker is. Adding caddy-docker-proxy was surprisingly straightforward, and as an added bonus it let me extricate myself from cloudflare’s clammy clutches.
All alliteration aside, getting split-DNS working with nextcloud has been a pain, so I’m documenting what I’ve tried, with the hope that someone knows the right way to do things.
Lets start by finding out what it takes to get the existing tt-rss docker instance working with caddy. It was very nearly as easy as following the caddy-docker-proxy github’s readme verbatim. I began by getting a shell on the docker host (./jlmkr.py shell docker
) and creating the caddy network: docker network create caddy
just like is in the readme.
Then I copied the provided example compose script and then made a few changes:
# Removed the version tag, because docker says it's deprecated now.
services:
caddy:
image: lucaslorentz/caddy-docker-proxy:2.9.1-alpine
ports:
- 80:80
- 443:443
environment:
- CADDY_INGRESS_NETWORKS=caddy
- CADDY_DOCKER_CADDYFILE_PATH=/etc/caddy/Caddyfile
networks:
- caddy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- caddy_data:/data
- /mnt/data/caddy/caddyfile/Caddyfile:/etc/caddy/Caddyfile
restart: unless-stopped
networks:
caddy:
external: true
volumes:
caddy_data: {}
It’s mostly the same. The big differences are manually setting the version number to not be bleeding edge, and the mounted Caddyfile path so I can write manual server blocks for services that aren’t docker containers. The docker container will automatically merge the provided Caddyfile with your label-based rules for other containers.
With that compose script copied into dockge, hit “Deploy” and let caddy boot up. Once that’s done, edit the tt-rss compose.yml in dockge:
...
web-nginx:
image: cthulhoo/ttrss-web-nginx:latest
restart: unless-stopped
env_file:
- .env
ports:
- 8280:80
#- ${HTTP_PORT}:80
volumes:
- app:/var/www/html:ro
depends_on:
- app
networks:
- caddy
- default
labels:
caddy: rss.my.domain
caddy.reverse_proxy: "{{upstreams 80}}"
volumes:
db: null
app: null
# backups: null
pgadmin-data: null
networks:
caddy:
external: true
N.B. You also need to have a CNAME or A type DNS record with your provider that points to the public IP, and have port 443 forwarded to the IP of the docker host.
Restart the container, and like magic caddy will use those compose labels to identify the service needing proxy, the domain to serve from, and it will grab SSL certs and start using them.
That was easy!