railway up uses Railpack instead of the service's configured Dockerfile builder
imatanury
HOBBYOP

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/Dockerfile

The 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 production

the resulting deployment metadata showed:

builder: RAILPACK

dockerfilePath: null

The deployment then failed during:

using build driver railpack-v0.36.4

railpack prepare exited with an error

The 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/Dockerfile

CLI deployment:

configFile: /railway.json

builder: RAILPACK

dockerfilePath: null

The 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:

  1. Does railway up inherit the builder configuration of an existing

    GitHub-connected service?

  2. Or does railway up independently determine the builder from the local

    upload/build context?

  3. When running railway up from /backend, is that directory treated as

    the build context/root?

  4. Should --path-as-root be used when deploying from a subdirectory?

  5. Is there an officially supported CLI option for explicitly selecting

    /backend/Dockerfile for railway up?

  6. What is the configuration precedence between service configuration,

    GitHub source configuration, railway.json, Dockerfile detection and

    Railpack detection?

  7. Is there a more detailed error available for the Railpack

    prepare exited with an error failure?

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.

$10 Bounty

2 Replies

Railway
BOT

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


7 days ago

Do you have root directory set on the service settings?


mayori

Do you have root directory set on the service settings?

imatanury
HOBBYOP

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.


Welcome!

Sign in to your Railway account to join the conversation.

Loading...