Use Dockerfile targets?
polvallverdu
FREEOP

2 years ago

Hey!

I'm new to railway, really excited to start using it. I want to deploy my app. It's on a monorepo, and a single Dockerfile is in charge of building different images based on the target.

Here's the Dockerfile, and for reference a docker-compose.build.yaml that servers as a way to build the images.

As an example, coolify supports this feature (where I come from)

Solved

15 Replies

polvallverdu
FREEOP

2 years ago

N/A


2 years ago

unfortunately railway does not support specfying a target, you would need to break the dockerfile up into separate dockerfiles


polvallverdu
FREEOP

2 years ago

Are there any plans to support this in the future?


2 years ago

there are no current plans, ive only seen you and one or two other people ask for it in the handful of years I've been doing support, so the drive for us to implement it is not there


polvallverdu
FREEOP

2 years ago

wow, interesting... I ended up adding a final step building a final image containing all the targets, which should do the job.


polvallverdu
FREEOP

2 years ago

Thank you for the quick response!


2 years ago

no problem!


polvallverdu
FREEOP

2 years ago

@Brody so the build just failed. I used the new build system.

ProjectId: f0ced8df-4b86-4697-ab99-b97b4c767fd6

ServiceId: 5297753e-5146-472c-af7d-e0099d9d3947

Deployment: 9df0747b-5963-4a85-a015-61f48d594ac0


polvallverdu
FREEOP

2 years ago

it says sigkill after not doing anything for 10 minutes


2 years ago

please do not use the new builder, it is beta, and will be deprecated soon


2 years ago

we cannot provide any support for builds done with it


polvallverdu
FREEOP

2 years ago

without the new builder I have to specify a cache id, and I can't do that for each file, since it's everything together


polvallverdu
FREEOP

2 years ago

I'm trying to build it with railpack, but now I can't. It says it's configured for docker because the config says so, but that's wrong: https://github.com/wosherco/bashbuddy/blob/main/railway.json


2 years ago

If you have a Dockerfile a Dockerfile is what will always be used regardless of what builder you have set.

And just an FYI, the new builder will be deprecated soon and your builds will not be ran with it anymore even if you previously enabled it, so please switch it off before we do.


2 years ago

!s


Status changed to Solved brody • over 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...