17 days ago
Project: appealing-playfulness (ID 81b9f947-6c76-432f-a397-4528fd679693), service coach_course_a_pied, Dockerfile builder, GitHub repo Macsime14/coach_course_a_pied (branch v1-coach).
Issue: every generated public domain returns an immediate 502 Bad Gateway (10-30ms response time, not a timeout), even though the deployment is Active/Online and the container logs show a completely clean, successful startup with no crashes or restarts.
What I've verified and ruled out:
- App (Next.js standalone server.js) binds to 0.0.0.0 and listens on the PORT env var Railway injects (confirmed 8080 in deploy logs: "Local: http://:8080").
- Public domain's target port is set to 8080, matching exactly.
- Dockerfile's EXPOSE was originally 3000 (stale); updated it to 8080 to match - no change in behavior.
- Tried in both US West and EU West regions - same immediate 502 in both.
- Deleted and regenerated the public domain twice (fresh *.up.railway.app domain both times) - same immediate 502.
- Deploy Logs show a single clean "Starting Container" -> Next.js ready -> pg-boss worker started, with no further restarts for the lifetime of the deployment (10+ minutes observed).
- Network Logs show the requests reaching Railway's edge (GET /, /api/health, /favicon.ico all logged) and getting 502 back in ~10-30ms - looks like the edge cannot establish a connection to the container at all, rather than the app erroring out.
- No healthcheck is configured (field is empty in Settings > Deploy), so it shouldn't be gating traffic.
- railway.json config-as-code file is present but I understand config-as-code was recently deprecated for services that never used it before - not sure if that's relevant here, flagging it in case.
I've spent a couple hours ruling out every application-level cause I could think of, all pointing to something on the platform/edge-routing side for this specific service. Would appreciate help digging into what's happening between the edge proxy and this specific container.
Latest deployment ID: 7d5f22d4 (EU West, "Corrige EXPOSE 3000 -> 8080..." commit).
1 Replies
17 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 17 days ago
17 days ago
In nextjs Dockerfile builds you need to set the HOSTNAME env variable to 0.0.0.0.