Skip to content

Commit 340e59c

Browse files
authored
Merge pull request #131 from HPaulson/hp/docs-env-fix
docs: Adds warning for env injection in docker-compose
2 parents d2fc4db + 4424847 commit 340e59c

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

  • apps/docs/content/docs/core/docker-compose

apps/docs/content/docs/core/docker-compose/index.mdx

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,32 @@ Dokploy provides two methods for creating Docker Compose configurations:
1818

1919
Configure the source of your code, the way your application is built, and also manage actions like deploying, updating, and deleting your application, and stopping it.
2020

21-
### Enviroment
21+
### Environment
2222

23-
A code editor within Dokploy allows you to specify environment variables for your Docker Compose file. By default, Dokploy creates a `.env` file in the specified Docker Compose file path.
23+
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`.
24+
25+
<Callout type="warning">
26+
Environment variables set in the UI are written to the `.env` file, but are **not automatically injected into containers**. You have two options:
27+
28+
**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:
29+
30+
```yaml
31+
services:
32+
app:
33+
env_file:
34+
- .env
35+
```
36+
37+
**2. Use specific variables** — Reference only the variables you need using the standard `${VAR_NAME}` syntax in your `docker-compose.yml`:
38+
39+
```yaml
40+
services:
41+
app:
42+
environment:
43+
- DATABASE_URL=${DATABASE_URL}
44+
- API_KEY=${API_KEY}
45+
```
46+
</Callout>
2447

2548
### Monitoring
2649

0 commit comments

Comments
 (0)