Remix Railroad Blues Stack

a year ago

Description: Remix + Postgres optimized for Railway

Category: Starters

URL: https://railway.app/template/plonEj

7 Replies

a year ago

in your schema.prisma file you are using DATABASE_URL but on the template you only have DATABASE_PRIVATE_URL


a year ago

in your schema.prisma file you are using DATABASE_URL but on the template you only have DATABASE_PRIVATE_URL

This is intentional because the build stage can only use the DATABASE_URL, not the private URL. The dockerfile is using ARG DATABASE_URL to make sure prisma can run migrations. Then, in the prisma client for the application, it uses url: process.env.DATABASE_PRIVATE_URL || process.env.DATABASE_URL to use private networking when deployed but use the more standard DATABASE_URL when running locally.


a year ago

you don't have a DATABASE_URL variable on the service either, if you are relying on the variable backfill, please don't as that behaviour will not stick around for much longer.


a year ago

I mean, I am confused why DATABASE_URL is available in the service without me defining it except for reading it in Dockerfile, but I ignored it because it is getting provided automatically somehow, and everything works.


a year ago

It is added automatically since you are using the provided Postgres database, please do not rely on this behavior, you should reference it yourself.


a year ago

Template is updated with it defined explicitly now. Thanks for the tip!


a year ago

awsome, nice work!