7 days ago
I'm investigating an unexpected builder selection when using railway up
against an existing GitHub-connected Railway service.
The service is connected to a GitHub repository and has historically deployed
successfully using:
builder: DOCKERFILE
dockerfilePath: /backend/DockerfileThe repository contains a tracked /backend/Dockerfile and
/backend/railway.json.
However, when I checked out a clean branch and ran railway up against the
existing production service:
railway up --service <existing-service> --environment productionthe resulting deployment metadata showed:
builder: RAILPACK
dockerfilePath: nullThe deployment then failed during:
using build driver railpack-v0.36.4
railpack prepare exited with an errorThe existing production deployment was not replaced and remained healthy.
The important difference I observed is:
Successful GitHub deployment:
configFile: /backend/railway.json
builder: DOCKERFILE
dockerfilePath: /backend/DockerfileCLI deployment:
configFile: /railway.json
builder: RAILPACK
dockerfilePath: nullThe CLI was executed from the repository's /backend directory.
I'm trying to understand the expected Railway behavior rather than report
this as a platform bug.
Questions:
-
Does
railway upinherit the builder configuration of an existingGitHub-connected service?
-
Or does
railway upindependently determine the builder from the localupload/build context?
-
When running
railway upfrom/backend, is that directory treated asthe build context/root?
-
Should
--path-as-rootbe used when deploying from a subdirectory? -
Is there an officially supported CLI option for explicitly selecting
/backend/Dockerfileforrailway up? -
What is the configuration precedence between service configuration,
GitHub source configuration,
railway.json, Dockerfile detection andRailpack detection?
-
Is there a more detailed error available for the Railpack
prepare exited with an errorfailure?
I would particularly appreciate clarification on whether this is expected
behavior for railway up or whether the CLI should inherit the existing
service's Dockerfile configuration.
Thank you.
2 Replies
7 days ago
This thread has been opened as a bounty so the community can help solve it.
Status changed to Open Railway • 7 days ago
mayori
Do you have root directory set on the service settings?
7 days ago
Yes. The service has its Root Directory configured as:
/backend
The normal GitHub-connected deployments use the Dockerfile successfully.
For this test, I also ran railway up from the /backend directory itself, but the CLI deployment selected Railpack instead of the Dockerfile.
I'm trying to understand whether railway up requires --path-as-root when deploying from a configured subdirectory.