build.sh: give actionable instructions when Caddy is unreachable

The old message just said 'expose manually if needed' with no guidance.
Now it prints the exact docker commands to publish the port directly
and how to find the container IP for a custom reverse proxy.

https://claude.ai/code/session_01FKCW3FDjNFj6jve4niMFXH
This commit is contained in:
Claude 2026-03-19 10:27:17 +00:00
parent 54ddc0d856
commit 3d35e220e4
No known key found for this signature in database

View file

@ -144,7 +144,11 @@ print(json.dumps(routes))
|| log "WARNING: Caddy update failed (app is running; fix routing manually)."
else
log "Caddy admin API not reachable; skipping route update."
log "Container $CONTAINER_NAME is running. Expose manually if needed."
log "Container ${CONTAINER_NAME} is running on port ${PORT} but not publicly routed."
log "To reach it directly, re-run the container with a published port:"
log " docker rm -f ${CONTAINER_NAME}"
log " docker run -d --name ${CONTAINER_NAME} -p ${PORT}:${PORT} ${IMAGE_TAG}"
log "Or point any reverse proxy at: \$(docker inspect ${CONTAINER_NAME} --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}'):${PORT}"
fi
# ── 7. Prune old images ───────────────────────────────────────────────────────