R
Railway2y ago
Medim

Reference variables between services

Just wondering... is it possible to reference a variable on my postgresql service (DB_HOST, DB_PORT...) on my other web service variables? like: ${{ DB_HOST }}
13 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
eirk
eirk2y ago
other variables arent
Medim
Medim2y ago
Well, it didnt.
eirk
eirk2y ago
did u make the databases after you already deployed ur other web service
Medim
Medim2y ago
had to configure it myself, it didnt detect my .env file on my project either no atleast this was simple to do, just copy/pasted it into the raw editor but the question remains, can I reference my service host variable on my web service variables?
eirk
eirk2y ago
what db is this
Medim
Medim2y ago
postgres
eirk
eirk2y ago
railway doesn't have these env vars where did u get this Postgres from did u deploy it urself
Medim
Medim2y ago
no, it was just an example if i were to reference it in another service
eirk
eirk2y ago
then this answers your question
Medim
Medim2y ago
Ok, thanks. For anyone finding this thread : You can use database variables on other services, but not other vars.
eirk
eirk2y ago
.