diff --git a/apps/docs/content/docs/core/docker-compose/index.mdx b/apps/docs/content/docs/core/docker-compose/index.mdx index 10b72c9..762f6c7 100644 --- a/apps/docs/content/docs/core/docker-compose/index.mdx +++ b/apps/docs/content/docs/core/docker-compose/index.mdx @@ -23,7 +23,9 @@ Configure the source of your code, the way your application is built, and also m The code editor in Dokploy allows you to define environment variables for your Docker Compose deployment. By default, Dokploy saves these variables to a `.env` file in the same directory as your `docker-compose.yml`. -Environment variables set in the UI are written to the `.env` file, but are **not automatically injected into containers**. To pass variables into a service, use the `env_file` option in your `docker-compose.yml`: +Environment variables set in the UI are written to the `.env` file, but are **not automatically injected into containers**. You have two options: + +**1. Inject all variables** — Use the `env_file` option in your `docker-compose.yml` to load every variable from the `.env` file into the container: ```yaml services: @@ -31,6 +33,16 @@ services: env_file: - .env ``` + +**2. Use specific variables** — Reference only the variables you need using the standard `${VAR_NAME}` syntax in your `docker-compose.yml`: + +```yaml +services: + app: + environment: + - DATABASE_URL=${DATABASE_URL} + - API_KEY=${API_KEY} +``` ### Monitoring