a month 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
0 Replies
a month ago
have you tried putting /apps/api/Dockerfile
a month 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
a month 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
a month ago
Yeah, change the path to this did the work.
a month 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.
a month ago
I'm confident that Railway does not search deeply into directories to locate a railway.json file.
a month 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.
a month 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?
a month 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.
a month ago
-# i think i misread the question a bit oops
a month ago
Maybe you could implement a small workaround by moving directories up when executing the build command and similar commands.