Deploying from Dockerfile not at root
kum0r
PROOP

a year ago

I made some changes to our deployment. I changed the project root up one level from where it previously used to be, since my Dockerfile now needs to pull in files to build from another directory at the same level as previous project root. I also changed the watch files setting to look for changes only in the directory I'm interested in (previous project root).

Since the new project root doesn't contain the Dockerfile, the railway build defaults to a nixpacks deployment and fails. I noticed that I could set a custom path to the Dockerfile using env variables. I added RAILWAYDOCKERFILEPATH as a variable and set the path to the Dockerfile.

It doesn't seem this doesn't trigger Docker deployment. The build still fails after attempting to do a deploy using nixpacks. How do I force the deployment to use docker deploy with the Dockerfile one level deeper than the root?

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

Solved

10 Replies

kum0r
PROOP

a year ago

Checking in on this? Any thoughts?


brody
EMPLOYEE

a year ago

Hello,

Try setting RAILWAY_DOCKER_FILEPATH to the absolute path, not a relative path.


Status changed to Awaiting User Response Railway 12 months ago


kum0r
PROOP

a year ago

When you say absolute path, from the Project Root?


Status changed to Awaiting Railway Response Railway 12 months ago


brody
EMPLOYEE

a year ago

Yes


Status changed to Awaiting User Response Railway 12 months ago


kum0r
PROOP

a year ago

Didn't help. I get the same error


Status changed to Awaiting Railway Response Railway 12 months ago


brody
EMPLOYEE

a year ago

The correct variable name may help haha -

https://docs.railway.com/guides/dockerfiles#custom-dockerfile-path

/payroll/Dockerfile


Status changed to Awaiting User Response Railway 12 months ago


kum0r
PROOP

a year ago

That didn't help either - /payroll/Dockerfile


Status changed to Awaiting Railway Response Railway 12 months ago


brody

The correct variable name may help haha -https://docs.railway.com/guides/dockerfiles#custom-dockerfile-path/payroll/Dockerfile

brody
EMPLOYEE

a year ago

The correct variable name may help.


Status changed to Awaiting User Response Railway 12 months ago


kum0r
PROOP

a year ago

I'm certainly blind. I have been staring at it for a while and didn't see the error. Thanks for pointing out. The build now picks up the Dockerfile. Thanks a bunch


Status changed to Awaiting Railway Response Railway 12 months ago


brody
EMPLOYEE

a year ago

No problem!


Status changed to Awaiting User Response Railway 12 months ago


Status changed to Solved brody 12 months ago


Loading...