PR Enviroments
moshetanzer
PROOP

a month ago

Hey,

Am a bit confused!

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

Solved$20 Bounty

Pinned Solution

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

8 Replies

Railway
BOT

a month 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 29 days ago


moshetanzer
PROOP

a month ago

This did not solve my issue. Seriously!


Status changed to Awaiting Railway Response Railway 29 days ago


Status changed to Open Railway 29 days ago


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


moshetanzer
PROOP

a month 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

a month 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

a month 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 🤔


Status changed to Solved 0x5b62656e5d 7 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...