How to set different environment variables for each instance?
golbin
PROOP

a year ago

Hello,

I’d like to run multiple instances of my service, and each instance needs different environment variables (for example, unique API keys). Is there a simple way to give each instance its own set of environment variables?

Thanks in advance!

Solved

3 Replies

a year ago

Hello,

We don't provide a way to give specific instances specific variables at this time.

Best,

Brody


Status changed to Awaiting User Response Railway over 1 year ago


titusg
PRO

a year ago

If specific variables per instance is not supported, how can we assign unique, persistent numeric IDs (0-1023) to instances in an autoscaling group that:

  1. remain consistent across container restarts
  2. are exposed as environment variables (e.g., INSTANCE_ID)
  3. Change only when a new instance is provisioned

Our distributed ID generator requires this for collision-free operation. Do you have a built-in solution ?


Status changed to Awaiting Railway Response Railway about 1 year ago



Status changed to Awaiting User Response Railway about 1 year ago


Railway
BOT

9 months ago

This thread has been marked as solved automatically due to a lack of recent activity. Please re-open this thread or create a new one if you require further assistance. Thank you!

Status changed to Solved Railway 10 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...