4 months ago
I am trying to deploy the application from a mono-repo.
I have defined the dockerfile path in /apps/api/railway.json file.
The dockerfile path lives inside /apps/api (directory)
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "DOCKERFILE",
"dockerfilePath": "api.prod.Dockerfile"
},
"deploy": {
"runtime": "V2",
"numReplicas": 1,
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10,
"healthcheckPath": "/healthz"
}
}Project ID: ef6ba77b-aa19-43cc-ad9d-6cb08b76ca23
11 Replies
4 months ago
have you tried putting /apps/api/Dockerfile
4 months ago
im pretty sure putting [api.prod](api.prod).Dockerfile means its trying to find a file with the name [api.prod](api.prod).Dockerfile
4 months ago
Hey, any reason on why you're using railway.json here? You could do that through the dashboard if necessary.
About your issue, I would say that you didn't set the root directory to /apps/api and thus Railway can't find that railway.json config file
4 months ago
Yeah, change the path to this did the work.
4 months ago
But it's quite strange because I had another project which I followed the same relative directory path and it works just fine in that.
4 months ago
I'm confident that Railway does not search deeply into directories to locate a railway.json file.
4 months ago
Hey, any reason on why you're using railway.json here? You could do that through the dashboard if necessary.
Keeping the configuration version controller via git helps to understand who made what change.
4 months ago
About your issue, I would say that you didn't set the root directory to /apps/api and thus Railway can't find that railway.json config file
But in that case wouldn't it affect how Docker context works, if we set the root directory path?
4 months ago
Yep, that would be an issue. Unfortunately, I don't see any configuration that can be done to specify a location of a railway.json file. Your best option here would be using the dashboard.
4 months ago
-# i think i misread the question a bit oops
4 months ago
Maybe you could implement a small workaround by moving directories up when executing the build command and similar commands.