dockerfile does not exists
mittalyashu
PROOP

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

have you tried putting /apps/api/Dockerfile


im pretty sure putting [api.prod](api.prod).Dockerfile means its trying to find a file with the name [api.prod](api.prod).Dockerfile


passos
MODERATOR

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


mittalyashu
PROOP

a month ago

Yeah, change the path to this did the work.


mittalyashu
PROOP

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.


passos
MODERATOR

a month ago

I'm confident that Railway does not search deeply into directories to locate a railway.json file.


mittalyashu
PROOP

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.


mittalyashu
PROOP

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?


passos
MODERATOR

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.


-# i think i misread the question a bit oops


passos
MODERATOR

a month ago

Maybe you could implement a small workaround by moving directories up when executing the build command and similar commands.


Loading...