Builder "DOCKERFILE" not working with buildEnvironment "V2"
kyldvs
PROOP

a year ago

I've been trying to switch a service over to buildEnvironment "V2" so that I have access to the private network while performing health checks.

Every time I turn on the new builder it ignores my Dockerfile settings and tries to use nixpacks. How can I make the new builder respect my Dockerfile? Here is my railway.toml structure:

[build]
buildEnvironment = "V2"
builder = "DOCKERFILE"
dockerfilePath = "/services/core/workflows/Dockerfile"
watchPatterns = ["/services/core/workflows/**/*", "/python/**/*"]

[deploy]
region = "us-west1"
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 10
startCommand = "/app/.venv/bin/silk_workflows_service"

Note: manually the root of the service is set to /python (I couldn't figure out how to specify this in railway.toml)

Solved

8 Replies

a year ago

Hello,

The V2 builder has many issues, this being one of them, we cannot recommend you use it as it is currently in an unmaintained state while we have pivoted our priorities elsewhere.

> access to the private network while performing health checks

Do you mean access to the private network during build? Health checks, despite showing in the build logs, are not run during the build.

Best,
Brody


Status changed to Awaiting User Response Railway about 1 year ago


kyldvs
PROOP

a year ago

Understood.

My underlying problem is that I want to run this healthcheck on my service which has no public network enabled (only private):

[deploy]
healthcheckPath = "http://workflows.railway.internal:8000/health"
healthcheckTimeout = 300

(I've also tried just /health instead of a fully qualified path)

But it always fails with service unavailable. If there is a way to get this healthceck working without using V2 that would be amazing


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

The healthcheck path is just that, a path, please only use a path going forward.

The V2 builder also does not have anything to do with health checks, as the builder is not responsible for health checks.

I would suggest using gunicorn with a uvicorn event worker, instead of just uvicorn.

Something like -

gunicorn -w 4 -k uvicorn.workers.UvicornWorker main:app


Status changed to Awaiting User Response Railway about 1 year ago


kyldvs
PROOP

a year ago

I got it working with gunicorn. Thank you. Feel free to mark this as resolved (I can't see how to do that on my end).


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

Happy to help!

(Only Admins / Mods can mark as solved)


Status changed to Awaiting User Response Railway about 1 year ago


a year ago

Looks like you increased your memeory 10 fold, if I had to guess you are tying your worker count to double the CPU count?

That is likely far more workers than you need, but up to you, just wanted you to be aware of this.


kyldvs
PROOP

a year ago

Thanks for flagging. Will monitor and see if we are okay with it. Yeah, you are right, I just copied the default StandaloneApp which has double cpu + 1.


Status changed to Awaiting Railway Response Railway about 1 year ago


a year ago

Sounds good, then I shall mark this as solved!


Status changed to Awaiting User Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Loading...