Docker + ASO + Env Vars #16213
Replies: 2 comments 3 replies
-
you can pass env variables with docker cli https://docs.docker.com/engine/reference/run/#env-environment-variables or docker compose |
Beta Was this translation helpful? Give feedback.
-
The problem isn't with ASO but with static pages. If you want to be able to create a single Docker image and use it with different environment variables, you won't be able to build static pages at all. The value of the variables is going to change so you need to use SSR ( If you want to have the benefit of static pages, you would have to build different images for each environment you plan to deploy your app |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
We're working on migrating a couple of things at once: full stack Django app -> Django API + Next.js, and standard "code on the box" style -> Docker (EC2 -> Fargate/ECS). We're also integrating w/ a headless CMS. This means that we have a few areas of the code that would need env vars:
getStaticPaths/Props
on the catch-all route used to serve CMS pages.REWRITE_TARGET
on the rewrites.Ideally, with Docker, you build one container and deploy it to multiple environments, but these env vars are involved at buildtime rather than runtime.
What options do I have here? Do any of them allow me to continue to take advantage of ASO?
Beta Was this translation helpful? Give feedback.
All reactions