docs: add tips to pass local environment variables to containers

This commit is contained in:
Romain Monteil 2023-03-27 13:44:38 +02:00 committed by Maxime Helias
parent f74c8c6cb8
commit 1afdd0127f

View File

@ -85,3 +85,18 @@ docker compose -f compose.yaml -f compose.prod.yaml up -d --wait
If you want to deploy your app on a cluster of machines, you can use [Docker Swarm](https://docs.docker.com/engine/swarm/stack-deploy/), If you want to deploy your app on a cluster of machines, you can use [Docker Swarm](https://docs.docker.com/engine/swarm/stack-deploy/),
which is compatible with the provided Compose files. which is compatible with the provided Compose files.
To deploy on Kubernetes, take a look at [the Helm chart provided with API Platform](https://api-platform.com/docs/deployment/kubernetes/), which can be easily adapted for use with Symfony Docker. To deploy on Kubernetes, take a look at [the Helm chart provided with API Platform](https://api-platform.com/docs/deployment/kubernetes/), which can be easily adapted for use with Symfony Docker.
## Passing local environment variables to containers
By default, `.env.local` and `.env.*.local` files are excluded from production images.
If you want to pass them to your containers, you can use the [`env_file` attribute](https://docs.docker.com/compose/environment-variables/set-environment-variables/#use-the-env_file-attribute):
```yaml
# compose.prod.yml
services:
php:
env_file:
- .env.prod.local
# ...
```