Build Projects from Different Dockerfiles

ayush-lalHOBBY

a year ago

Hi guys,

Quick question - is it possible to build multiple different projects from dockerfiles that exist in the same directory?

Given the following folder structure:

.
└── src/
    └── server/
        ├── Dockerfile
        ├── Dockerfile.test
        ├── Service/
        ├── Domain/
        └── API/

My API project is successfully building in railway. The root directory is configured as "/src/server/" .

My Service project however is not building (same root directory configuration as above) when trying to target Dockerfile.test which i specified as a service variable:
RAILWAYDOCKERFILEPATH=Dockerfile.test

any ideas on what im doing wrong? Perhaps im misunderstanding this guide:
https://docs.railway.app/guides/dockerfiles

0 Replies

ayush-lalHOBBY

a year ago

71e9ecca-8ad5-42c6-8450-e3b64ec2edab


ayush-lalHOBBY

a year ago

build error for my service project:

[Region: us-west1]
Dockerfile `Dockerfile.test` does not exist

a year ago

i think you want RAILWAY_DOCKERFILE_PATH=/src/server/Dockerfile.test


ayush-lalHOBBY

a year ago

Ah thanks Brody that was it! I thought configuring the root directory would have me covered there. Thanks again for your time 😃


a year ago

i know, its odd


Build Projects from Different Dockerfiles - Railway Help Station