Skip to content

Let lab-net containers reach eln.ddomlab.org through Caddy - #4

Merged
rcb1409 merged 1 commit into
mainfrom
lab-net-alias
Sep 28, 2026
Merged

rcb1409 merged 1 commit into
mainfrom
lab-net-alias

Conversation

@rcb1409

@rcb1409 rcb1409 commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Problem

During the eln_server deploy, the new eln-server container was healthy but couldn't reach eLabFTW. https://eln.ddomlab.org/api/v2/info timed out from inside the container (from the host and from outside, it answers 401 as expected).

Inside a container, eln.ddomlab.org resolves to the server's own public IP. Docker doesn't route a container's call to its own host's published port back through Docker's port forwarding, so the packet lands on the host's firewall, which only allows SSH, and gets dropped.

Fix

Give the Caddy container the network alias eln.ddomlab.org on lab-net. Docker's internal DNS answers that name with Caddy's container IP for containers on lab-net, so eln-server talks to Caddy directly: same valid Let's Encrypt certificate, same route to eLabFTW, and it shows up in the Caddy access log. Clients outside Docker aren't affected, and there's no firewall change.

Tested

  • docker compose config: valid.
  • Local Docker test: a container on the network resolved the alias to the Caddy container's IP (172.25.0.2), not public DNS.

Deploy

The compose file changed, so Caddy must be recreated: sudo docker compose up -d in /opt/edge (a plain restart doesn't apply compose changes). This also picks up the :5000 route from #3. The site drops for a second or two.

🤖 Generated with Claude Code

eln-server calls eLabFTW's API at https://eln.ddomlab.org. From inside a
container that name resolves to the server's own public IP, and the host
firewall drops that traffic, so the call times out. A network alias makes
the name resolve to the Caddy container on lab-net instead: same
certificate, same route to eLabFTW, and no firewall change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rcb1409
rcb1409 merged commit cb57798 into main Sep 28, 2026
@rcb1409
rcb1409 deleted the lab-net-alias branch September 28, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants