dmays
1
I’m trying to deploy an Astro application to Fly.io that uses a .env file for local settings and a .env.production for production settings / secrets.
After deploying, it seems that the .env.production variables are not accessible when the program uses import.meta.env.PUBLIC_APP_ID for example.
How can I utilize .env.production with fly.io?
I don’t think import.meta.env.PUBLIC_APP_ID would read from the fly secrets, so I’m not sure where to go.
dmays
3
Thanks! So use real environment variables instead of .env, I can make that switch. (Or is there some other preferred mechanism?)
Astro uses Vite’s environment variable support and statically replaces them at build time. Not sure if that means using dotenv.
system
Closed
4
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.