#Healthcheck runs after building, before start NextJS
3 messages · Page 1 of 1 (latest)
New reply sent from Central Station thread:
It’s not necessarily a bug—more a timing or configuration issue.
Most PaaS/container platforms start the health-check
as soon as the container port becomes reachable
, regardless of whether your
RUN
command has finished its own internal start-up logic.
So the sequence you see is:
- Image builds → OK
- Container is started → port 8080 (or whatever you exposed) is bound almost immediately
- Platform begins health-checks → may fail if your app hasn’t actually finished initialising
- Your
RUN
command finally finishes initialising → health-check would succeed if the platform hadn’t already killed the container
You're seeing this because this thread has been automatically linked to the Central Station thread.
New reply sent from Central Station thread:
Can you provide build logs here.
Adding a startup delay or readiness probe
inside your app (e.g., only respond 200 OK after initialization).
Or, if Railway lets you,
increase the healthcheck timeout or interval
.
You're seeing this because this thread has been automatically linked to the Central Station thread.