mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-04-05 11:51:32 +00:00
Add reproducer for coolify#8953: .env not found with preserve repository (#65)
Minimal Docker Compose example that triggers the deployment failure when Preserve Repository is enabled with a custom start command containing variable interpolation. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
38
docker-compose-preserve-repo-env/README.md
Normal file
38
docker-compose-preserve-repo-env/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
# Reproducer for coolify#8953
|
||||
|
||||
Minimal Docker Compose app that uses `${WEB_PORT}` variable interpolation to
|
||||
reproduce the `.env not found` error when **Preserve Repository** is enabled
|
||||
with a custom start command.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1. In Coolify, create a **Docker Compose** application pointing to this
|
||||
repository subdirectory (`docker-compose-preserve-repo-env`).
|
||||
2. Add an environment variable: `WEB_PORT=9090`.
|
||||
3. In **Advanced** settings, enable **Preserve Repository**.
|
||||
4. Set the custom start command to:
|
||||
```
|
||||
docker compose -f docker-compose.yaml -f docker-compose.prod.yaml up -d
|
||||
```
|
||||
5. Deploy.
|
||||
|
||||
### Expected (after fix)
|
||||
|
||||
Deployment succeeds. `--project-directory` in the `up -d` command points to
|
||||
`/data/coolify/applications/{uuid}` (host path where `.env` exists).
|
||||
|
||||
### Actual (before fix)
|
||||
|
||||
Deployment fails with:
|
||||
|
||||
```
|
||||
env file /artifacts/{deployment_uuid}/.env not found
|
||||
```
|
||||
|
||||
Because `--project-directory` was set to `/artifacts/{deployment_uuid}` (helper
|
||||
container path), and Docker Compose resolves `env_file` directives relative to
|
||||
that directory.
|
||||
|
||||
## Related
|
||||
|
||||
- https://github.com/coollabsio/coolify/issues/8953
|
||||
@@ -0,0 +1,3 @@
|
||||
services:
|
||||
web:
|
||||
restart: always
|
||||
5
docker-compose-preserve-repo-env/docker-compose.yaml
Normal file
5
docker-compose-preserve-repo-env/docker-compose.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
services:
|
||||
web:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "${WEB_PORT:-8080}:80"
|
||||
Reference in New Issue
Block a user