dockerfile does not exists

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

Closed

11 Replies

have you tried putting /apps/api/Dockerfile


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


a year 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


Yeah, change the path to this did the work.


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 year ago

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


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.


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 year 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


a year ago

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


Welcome!

Sign in to your Railway account to join the conversation.

Loading...