Setting up a local environment

For a variety of reasons I typically like to develop completely locally. I'm using the Next.js / Prisma template and the docs seem to suggest that I should just create a "dev" environment in Railway but I'd prefer to spin up a local postgres instance in a docker container. I see that the prisma file has a way to route to a local db instance, but was wondering if there's a Railway recommended to setup this type of environment with the CLI so that I don't have to manually be flipping this string.
5 Replies
Percy
Percy2y ago
Project ID: N/A
cstoneham
cstoneham2y ago
N/A
eirk
eirk2y ago
theres nothing like that tmk u could add some logic to ur code so it looks for a different env var if the ENVIRONMENT variable isn't production or smth like that
JustJake
JustJake2y ago
Best way to do this would be to setup your local instance, and then take that DATABASE_URL and set it on your service in the dev environment, if that makes sense Would love to make this better over time but that's where it's at ATM
cstoneham
cstoneham2y ago
ah gotcha, thanks for the responses, yeah so basically set the DATABASE_URL in the dev instance on the railway webapp to point to a localhost instance right?