how to set a runtime environment for strapi?
i’ve build my docker without an env and run it with runtime env but it doesnt seem to work.
This topic has been created from a Discord post (1299169856666468442) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
Hi Fina, what do you mean with “doesnt seems to work”?
I’m using (Strapi v5) docker for development and production and everything runs perfectly
Hello Mauro, thanks for your response!
At the moment, I’m using Docker for deployment, and it’s working well. However, my concern is that I need to copy the .env file during the Docker build process (build-time environment).
For my next deployment, I’ll be using Kubernetes, and due to security reasons, I’m not allowed to store the .env file in the system. When I try building the Docker image without including the .env file (using runtime environment) and then run the Docker container with the --env-file .env command, it fails.
Did you try to run it using inline ENVS?
that would work. but i need it to be stored on my env
And where is stored the .env while you’re running the container using --env-file?
in k8s you would specify the environment variables in the pod config
Have you encountered this issue before, where the build fails if the environment variables are missing at build time? What should I do in that case if I’m using kube?
Depends on the missing var but you just specify them (depends on how your running it), if your just running a kube command with no config then you have to manually specify them.