R
Railwayβ€’2y ago
Yashu

Docker deployments is not processing ENVs correctly

I am using railway postgres & redis database with built-in variables REDIS_URL and DATABASE_URL In the Deploy logs, it throwing an error. REDIS: error: Error: connect ENOENT/$%7B%7B%20REDIS_URL%20%7D%7D I've already added environment variables as ARG in dockerfile.
9 Replies
Faraz
Farazβ€’2y ago
Project ID?
Yashu
Yashuβ€’2y ago
1c84f53b-ad17-4583-8b37-99f4dd6c7227
Faraz
Farazβ€’2y ago
The part that's throwing, how are you using it in your code? And could you try logging it to see what it logs?
Yashu
Yashuβ€’2y ago
Just this: ${{ REDIS_URL }} Reading the environment variable, process.env.REDIS_URL (in JS)
Faraz
Farazβ€’2y ago
Could you try removing the REDIS_URL variable from the api service? It should be available already.
Yashu
Yashuβ€’2y ago
I have added the variable like this?
Yashu
Yashuβ€’2y ago
Should I remove it?
Faraz
Farazβ€’2y ago
Yep. Plugin variables are already available to services.
Yashu
Yashuβ€’2y ago
let me try it Oh! now it's logging the correct redis connection URL in logs. πŸ‘Œ Thanks πŸ™‚