2 months ago
I have a Dockerfile at root. I use it to deploy and build images for Github actions. I want to try out Railway. But I can't get railway to ignore my Dockerfile and use the Railpack builder
This is my toml file
# Railway Configuration for Stance
# Docs: https://docs.railway.com/reference/config-as-code
[build]
# Use Railpack (new Railway builder as of March 2025)
builder = "RAILPACK"
# Install dependencies only
buildCommand = "bun install --frozen-lockfile"
[deploy]
# Run initialization script then start process manager
startCommand = "./railway-init.sh && bun src/process-manager.ts"
healthcheckPath = "/api/health"
healthcheckTimeout = 300
restartPolicyType = "ON_FAILURE"
restartPolicyMaxRetries = 3
# For PR environments
[environments.pr]
# Inherit most config from production but override what's neededBut whenever I build in the Railway UI I see this
> Configuration merged from service settings and /railway.toml
[build]
builder = "DOCKERFILE"
buildCommand = "bun install --frozen-lockfile"
dockerfilePath = "/Dockerfile"
buildEnvironment = "V3"I would like it to respect my toml file which is present in the codebase, and I have ensured that my service settings ALSO say that Railpack should be used.
1 Replies
2 months ago
Hi there
Railway will always prioritize a Dockerfile at your root directory over the builder setting, so if you want to use Railpack instead, you'll need to work around that detection.
The easiest fix is to rename your Dockerfile to something like Dockerfile.github or github.Dockerfile—Railway only auto-detects files named exactly Dockerfile with a capital D. Your GitHub Actions workflow can still reference it by the new name. Alternatively, you could move the Dockerfile into a subdirectory like .github/ and update your GitHub Actions to point there instead. Either way, you'll free up Railway to use Railpack while keeping your Dockerfile available for GitHub Actions.
Status changed to Awaiting User Response Railway • about 2 months ago
a month ago
This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!
Status changed to Solved Railway • about 1 month ago