I’m trying to deploy my Astro SSR app to fly.io but all my env vars are undefined.
I created an Astro SSR app just to test this issue. It only has one page, set up in ssr mode with node adapter.
It doesn’t matter if I set it with fly secrets, the fly.toml or in the web interface. Re-deploying the secrets or the whole app doesn’t fix the issue. When I set the secrets with the CLI, it does register on the web interface so the problem must be with the build.
The app can read the env vars in development mode and the local build works too. I need these env vars in runtime. The Astro and Fly.io documentation doesn’t say anything about additional steps or I couldn’t find anything.
I would really appreciate some help here. Thanks in advance.
This means that Astro can only use ENV variables that are set in the Dockerfile itself. If any of those variables are secrets, you will need to use mounts: Build Secrets · Fly Docs