Creating .env file on deploy
Hi!
Is it possible to create .env file instead of using system environment variables from the UI?
15 Replies
Project ID:
aba163f0-3827-4fcb-8b18-23cc52b79543
aba163f0-3827-4fcb-8b18-23cc52b79543
may I ask the usecase?
In Next.js they use .env only https://nextjs.org/docs/app/building-your-application/configuring/environment-variables
when i export it locally i'm getting
It's irrelevant to Railway, but only asking if we can use .env files at Railway
Configuring: Environment Variables | Next.js
Learn to add and access environment variables in your Next.js application.
I assure you next does not only use .env files
It's actually medusajs, https://docs.medusajs.com/learn/advanced-development/environment-variables, but i'm getting that error, i'm sure i have it exported DATABASE_URL
are you using a Dockerfile?
medusa is built on top of next
no i'm not using docker
then I would recommend fixing your project configurations so that you are not limiting yourself to .env files
This is where they load envs
but its not there
ok
thanks
are you using turbo?
No just yarn
yarn run setup-db
have you deployed the changes after adding the variable to your Railway service
No i haven't, currently i'm looking if i can use .env file instead, because with env file envs load, using export they don't
try using service variables please