Why does healthcheck happen before starting container?
harunsmrkovic
PROOP

a year ago

I might be missing something super obvious here, but I have a very simple healthcheck configured for /api/health path in my next.js app, and it is never reachable.

But I see the healthcheck logs in the Build phase, not Deploy. How is my application supposed to "start" before start command is executed?

Or is there some implicit command going on in build phase that is supposed to enable healthcheck to run?

In my healthcheck I am connecting to database, so I am not sure if this is possible…

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

1 Replies

a year ago

Hello,

Despite the health check printing in the build logs, the health check is only started after the container was started, you can check this fact by clicking the deploy tab while the health check is running to see the logs from your app.

One thing to know is that the healthcheck path is a path, it looks like you tried to under a full URL.

Some other useful docs on health checks can be found here -

https://docs.railway.com/guides/healthchecks-and-restarts

Best,

Brody


Status changed to Awaiting User Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Loading...