NathanVaughn / webtrees-docker

Up-to-date Docker image for webtrees with all the bells and whistles.
https://hub.docker.com/r/nathanvaughn/webtrees
MIT License
64 stars 15 forks source link

Networks, and using Caddy as a reverse proxy? #150

Closed amca01 closed 3 weeks ago

amca01 commented 3 weeks ago

Hello,

Since I have other apps running in Docker containers, for each new multi-container app I need to create a network so that all the components can talk to each other. And then the main outward-facing container needs to be linked to my Caddy instance, for a reverse-proxy and handling of certificates.

But there seems to be an issue with networks, in that my attempts to start up the containers with "docker compose up -d" resulted in the error

validating /home/me/Docker/Webtrees/compose.yaml: services.app.networks.0 must be a string

How do I get round this? (I notice that you do say that Webtrees docker doesn't play well with reverse proxies, but that seems to be after it's started - I can't even do that.)

Many thanks!

NathanVaughn commented 3 weeks ago

Could you post your Docker compose file? This isn't a container issue, you've got an issue in your docker-compose YAML file. The documentation about networks is here

My guess is you're naming your network something like "0" which YAML will interpret as an integer.

amca01 commented 3 weeks ago

Many thanks - I worked it out; it was a punctuation issue of all things. Now my next roadblock is managing to use Caddy as a reverse proxy, for managing certificates. I'm on the lookout for an up-to-date Caddyfile. The only one I've found so far is here, and that's nearly six years old.

NathanVaughn commented 3 weeks ago

I've never used Caddy before, but from a quick google, you're going to want to use it as a reverse-proxy. This container already runs an Apache server and exposes port 80 for HTTP data. The container already takes care of any URL rewriting required.

amca01 commented 3 weeks ago

Many thanks - I can normally set up Caddy for any dockerised app, as long as I've included the app in the local Caddy network. But for reasons I haven't yet figured out, I'm not able to at the moment. I'll simply keep fiddling and hunting about. Thank you again!