I recommend adding hostname: app-name
lines for each container then you can just use the hostname and the native port (even if you don’t pass it through with a port:
line).
It’s super useful if you want to expose any apps with a reverse proxy like Caddy. That way the ONLY way to access an apps web interface is via the reverse proxy. Then look at filter rules to deny access unless the client has a LAN IP.
Poof, you’ve got SSL and custom subdomains for all your apps, but still only on your LAN or personal VPN (like Wireguard or Tailscale).
If you want to PM me your
docker-compose.yml
andCaddyfile
I’m more than happy to take a look at them for you. I’ve been using Caddy as my rev-proxy for 10+ app stacks for a few years now.