I'm developing a web app based on React. This app shall be able to run as a Docker container in production. I created an .env.development
file in my repository in which I can configure an API endpoint the app will be connecting to.
REACT_APP_API_BASE_URL=http://localhost:8180/api
Running the container on my local machine works fine this way.
Now I'd like to run this container in a Docker stack so I configured a docker-compose.yml
.
- Where and how should I store/manage the above configuration so that the Docker stack will pick it up? Is there something like a "recommended way"?
- Is it enough to define this parameter in the
environment
section of thedocker-compose.yml
? Or do I need to use something like Docker config or even Docker Secrets?