From 60e698faa55508e54c3492bbd957bb4d2beab0a2 Mon Sep 17 00:00:00 2001 From: TheMaddax Date: Wed, 4 Mar 2026 15:08:32 -0700 Subject: [PATCH] Add Caddy reverse proxy and Docker networking documentation to Memory Bank --- cline_docs/techContext.md | 57 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/cline_docs/techContext.md b/cline_docs/techContext.md index 1976af3..00b2aa6 100644 --- a/cline_docs/techContext.md +++ b/cline_docs/techContext.md @@ -36,3 +36,60 @@ - TypeScript for type checking - Framer Motion for animations - Tailwind for styling + +## Production Server Configuration (10.4.0.205) + +### Caddy Reverse Proxy +- **Location:** `~/docker/caddy/config/Caddyfile` +- **Container Name:** `caddy` +- **Admin API:** `0.0.0.0:2019` + +### DeafMissoula.org Configuration +- **Docker Container:** `deafmissoulaorg-app-1` +- **Internal Port:** 801 +- **Docker Network:** Separate from Caddy (different network IDs) +- **Current IP:** 172.18.0.6 (as of March 4, 2026) + +**Important:** Because Caddy and deafmissoula containers are on different Docker networks, the Caddyfile must use IP addresses instead of container names for routing. + +### Caddyfile Entry: +``` +deafmissoula.org { + reverse_proxy 172.18.0.6:801 +} +``` + +### Common Issues & Solutions + +#### Issue: Website returns 502 after Docker rebuild +**Cause:** Docker container IP address changed during rebuild + +**Solution:** +1. Check current container IP: + ```bash + ssh chaulmark@10.4.0.205 "docker inspect deafmissoulaorg-app-1 --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'" + ``` + +2. Update Caddyfile: + ```bash + # Download Caddyfile + scp chaulmark@10.4.0.205:~/docker/caddy/config/Caddyfile /tmp/Caddyfile + + # Edit locally to update IP address in deafmissoula.org section + + # Upload back + scp /tmp/Caddyfile chaulmark@10.4.0.205:~/docker/caddy/config/Caddyfile + ``` + +3. Reload Caddy: + ```bash + ssh chaulmark@10.4.0.205 "docker exec caddy caddy reload --config /etc/caddy/Caddyfile" + ``` + +4. Verify: + ```bash + curl -I https://deafmissoula.org + ``` + +#### Better Long-term Solution +Connect both Caddy and deafmissoula containers to the same Docker network to use container names instead of IP addresses, which would prevent this issue.