1. The problem I’m having:
I want to be able to forward sub.subdomain requests backend things, but automatically
I use docker compose for everything and I want to be able to use
container-name.d.example.com and automatically reverse proxy
container-name to that address, without having to add an entry for every single one
I would likely restrict this entire sub.sub.domain with basic auth so that wont be much of a security problem, this is mainly so that I can have an outbound URL
2. Error messages and/or full log output:
3. Caddy version:
4. How I installed and ran Caddy:
a. System environment:
Arch Host (assume latest packages as of Nov 15, 2023 as that was latest update)
docker compose up -d
c. Service/unit/compose file:
- 2019/tcp ## exposes to local network
d. My complete Caddy config:
N/A for this question
Will provide if asked
is there a way this can be easily integrated into my already existing webserver? Like would I be able to just add an entry for this in my current caddy files and let it handle the rest for that subdomain?
You just swap out your
caddy:latest container with CDP’s and then you can add labels to each service to have Caddyfile config automatically generated from your running containers.
Will it work with containers that are not a part of the master compose file?
I have my “core services” file located in
/docker, and then have secondary services such as minecraft servers in their own individual compose files
do I just add the lable and it automatically detects those?
Tried to just swap it out, added the label for my git server (in the root compose file) and it just doesnt work, it does not load my previous caddy files, nor does it actually proxy gitea, it just shows an blank page for domains that have “labels” for
Read its docs. You can specify a base Caddyfile, and you can configure the Docker network to use to detect containers.
Yeah I managed to get it to work, my dumb brain was using the wrong port in the “upstreams” config, need to get that caddyfile tho