docker: Align compose healthcheck with admin port #11
Reference in New Issue
Block a user
Delete Branch "ash/docker-align-compose-ports"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
docker-compose.ymlhealthcheck probeshttp://127.0.0.1:81/api, but the binary defaultsADMIN_PORTto 8081. A stockcompose uptherefore never becomes healthy. DockerfileEXPOSE 80 81 443also implied those listen ports without compose setting the matching env. README quick-start claimed admin:81for a bare binary (real defaults are127.0.0.1:8081/:8080/:18443).Why
Option A: keep published Docker story on 80/81/443. Set compose env overrides so the process listens where EXPOSE and the healthcheck already expect, and tell the truth in README for binary vs Docker.
Changes
docker-compose.yml: activeADMIN_PORT=81,PROXY_HTTP_PORT=80,PROXY_HTTPS_PORT=443(ADMIN_HOSTleft default127.0.0.1for in-container healthcheck). EXPOSE/healthcheck unchanged.README.md: binary quick-start documents real defaults; Docker section documents 80/81/443 via env.Test
ADMIN_PORT=81+ default loopback host.PROXY_HTTP_PORT8080 (internal/proxy/engine.go), HTTPS 18443.Fixes: #10
Triage (Linus):
Option A as scoped. Compose sets ADMIN_PORT/PROXY_* to match EXPOSE + healthcheck on 81/80/443. README same-PR: binary defaults vs Docker env story no longer lie. CI green (gofmt, build, go tests). mergeable.
Docs bar: satisfied for this change.
Next action: Eva merge (delete head). Close #10 on land.