herzenschein / herz-quadlet

A repository where I store my podman quadlets.
9 stars 0 forks source link

Thank you for this repo! #1

Open felixfischer opened 1 year ago

felixfischer commented 1 year ago

Hey there,

I was searching GitHub for quadlet examples and found that your repo by far the most useful one. So let me just thank you for your work! The README is especially useful!

I see that you have a caddy quadlet that comes with a network. Do you have experience using it as a reverse proxy for multiple container services? Any code you could share? I am usually working with podman-compose and the OS's caddy these days, but would like to explore more the possibilities of quadlet only setups for my app servers.

Thank you again, and have a nice day 🙋‍♂️ Felix

herzenschein commented 1 year ago

Hey there, thank you for your kind words!

Yeah, Caddy is one of the quadlets I use in production. The only thing I need to do is add Network=samenetascaddy.network to the containers I want exposed to Caddy, then I can mention them on my Caddyfile. If I'm not misremembering, Caddy won't be able to see other containers unless they are on the same network. Then you'll mostly use Caddy the same as if on the host, the bare minimum being like the following.

If you have static webpages and just want to serve them:

somewebpage.website.com {
    root * /srv/somewebpage # assuming you mounted /path/to/site/somewebpage:/srv:ro,z
    file_server
}

If you have services running at a certain port, you can do this:

someservice.website.com {
    reverse_proxy ip:port # <-- Here, IP can be the container name!
}

It's really nothing fancy, but it's worth noting that, from what I've read on their Discourse forum, the Caddy container requires ports 80 and 443 for the ACME challenges, so you can't do something like 8080:80 and 4443:443. They must be 80:80 and 443:443.