Dockerfile image

cerefrePRO

9 months ago

My Dockerfile specifies a dev and prod image. How does railway know to build the prod image?

(It is building the prod image, like I want, just curious how it knows.)

Awaiting User Response

1 Replies

chandrikaEMPLOYEE

9 months ago

Hi there

That's an excellent question - in this case, it might just be luck as the prod image is declared after dev

If you want that control, I'd recommend declaring separate Dockerfiles for dev and prod. Then, for each case, you can specify which Dockerfile you'd like Railway to use in the custom dockerfile path: https://docs.railway.app/guides/dockerfiles#custom-dockerfile-path


Status changed to Awaiting User Response railway[bot] 9 months ago