PR Enviroments
moshetanzer
PROOP

9 days ago

Hey,

Am a bit confused!

Is there a way to have the postgres and redis of main env availbe in pr enviroment automaticaly?

$20 Bounty

8 Replies

Railway
BOT

9 days ago

PR environments are fully isolated, so each one spins up its own instances of all services in the project, including Postgres and Redis, with fresh empty volumes and regenerated credentials. There is no built-in setting to automatically share the production database services with PR environments. If you want your PR environment app services to connect to the production databases instead of the ephemeral ones, you would need to manually override the connection variables (e.g. DATABASE_URL, REDIS_URL) in those PR environments to point to the production instances.


Status changed to Awaiting User Response Railway 9 days ago


moshetanzer
PROOP

9 days ago

This did not solve my issue. Seriously!


Status changed to Awaiting Railway Response Railway 9 days ago


Status changed to Open Railway 9 days ago


Could you clarify? Are you looking to 'import' the data of the main environment to your PR environment?


moshetanzer
PROOP

8 days ago

Just have a solid set of env bars that point to the main env db and redis etc


moshetanzer

Just have a solid set of env bars that point to the main env db and redis etc

Unless you use the public URLs, you won't be able to use private networking to access services in other environments.

You can create shared variables containing public URLs of your databases from your project settings, then in the PR environment configurations, set the base environment to the environment with the shared variables.

https://docs.railway.com/variables#shared-variables

83053.png

Attachments


moshetanzer
PROOP

7 days ago

that is what I understand. But that seems like insanity!


What seems like insanity…? It makes sense that services in other environments don’t have access to other services in a different environment via private networking. It’s in a different environment for a reason. You don’t want to accidentally break a production database…


moshetanzer
PROOP

7 days ago

that is a users choice. A rc web app will never break production 😂 - if it does the problem is not the cloud. The same way I can set a public url - railway should offer a private url. Not sure what you are even saying 🤔


Welcome!

Sign in to your Railway account to join the conversation.

Loading...