I added a new docker container for the Monica CRM following this guide. The docker container itself is working fine, it maps the host port 3000 to container port 80. If I try accessing the service through my server’s ip like so: http:ipaddress:3000 I’m able to use the service.
However, I wanted to assign a domain name to it. I’ve done this in the past by having sub.domain.com point to my server ip address, and from there using Caddy to proxy the request. Here’s what my Caddyfile looks like:
The blog proxy works fine, but the crm one does not (throws 502). The logs show nothing of importance, just lines like this (from me testing the domains):
The IP addresses that the proxies point to in the Caddyfile were found through Docker inspect, and again it works for the blog subdomain, so I’m not sure what’s going on with the new one. Any thoughts?
What could be causing the timeout? Monica, my blog, and caddy all run in docker containers, but caddy seems to have no trouble proxying to the blog container, and I’m able to curl the Monica container just fine.
Nevermind, solved it! The way the monica docker containers were being built was putting them on a separate network than the rest of my containers, so they weren’t able to communicate. I fixed this by adding the network_mode directive for the services in the monica docker-compose.yml so that they’d be attached to my existing network.