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
Project ID:
N/A
N/A
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
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
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?