Preview Compose deletes the compose's .env
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 53/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker-compose, git, typescript
Hướng nghiên cứu
Read compose.fetchSourceType, cloneCompose, and the Git providers’ outputPathOverride handling, then trace the preview dialog and loadServices refresh path. Check how getBuildComposeCommand writes .env and how startCompose uses the checkout. The reported failure is resolved when preview and refresh leave the deployed checkout, .env, and deployed commit intact.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
To Reproduce
- Create a Docker Compose service from a GitHub repo, with "Create Env File" on and a compose file whose variables are required (
${WEB_ORIGIN:?...}). - Deploy it. The
.envis now next to the compose file in/etc/dokploy/compose/<appName>/code/. - Open General → Preview Compose.
- Look at that folder again: the
.envis gone, andgit reflogincode/shows a fresh clone. - Run a
docker composecommand for the project from that folder. Ours is a server schedule:docker compose -p <appName> -f deploy/dokploy/compose.yaml --profile ops run --rm ops <command>. It fails with:
error while interpolating services.worker.environment.WEB_ORIGIN: required variable WEB_ORIGIN is missing a value
Current vs. Expected behavior
I expected the preview to leave the deployed compose as it was. Instead it re-clones the repo and the .env from the last deploy is gone. The running containers are fine, but anything that runs docker compose in that folder fails until the next deploy. Two nightly schedules of ours failed the night after I opened the preview.
Provide environment information
Operating System:
OS: Debian GNU/Linux 13 (trixie)
Arch: x86_64
Dokploy version: v0.31.0
VPS Provider: OVH
What applications/services are you tying to deploy?
Docker Compose from GitHub (Node API, worker, Postgres, nginx), plus server schedules that run `docker compose ... run` on it
Docker 29.9.3, Docker Compose v5.6.1
Which area(s) are affected? (Select all that apply)
Docker Compose
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
The dialog calls compose.fetchSourceType when it opens. That runs cloneCompose, and the git providers start with rm -rf on the code path. The .env is only written in getBuildComposeCommand, so only a deploy brings it back. The refresh button next to the service picker (loadServices with type: "fetch") does the same.
From reading startCompose, it runs docker compose up -d in that same folder without --env-file, so I'd expect Start to break the same way after a preview. I haven't tried that one.
I think the preview and loadServices should clone into a temporary folder, read the compose from there and remove it, so code/ only changes on a deploy. The git providers already take an outputPathOverride. Writing the .env back after the clone would hide the error, but code/ would still be left on the latest commit of the branch instead of the deployed one, and a Start after that would bring up a compose that was never deployed.
Will you send a PR to fix it?
Yes
- Ngôn ngữ chính
- TypeScript
- Star
- 38.8k
- Fork
- 3.2k
- Merge trung bình
- 1 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 110
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Dokploy/dokploy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6151 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Healthy Swarm task shows an empty `(Error:)` suffix on the last row of the Containers tabCó thể đã có người làm @AyhamJo7 đã nhận 5 ngày trước. Đang mởneeds-triage🔍
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Dokploy/dokploy#6115 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Global search (Cmd/Ctrl+J) never sorts results by relevanceCó thể đã có người làm @hamidzr đã nhận 6 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Dokploy/dokploy#6107 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`utils/dns/ovh.ts`: the zone-listing 403 handler replaces the provider's error instead of chaining itCó thể đã có người làm @SyncWithRaj đã nhận 9 ngày trước. Đang mởbug
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 84/100
Dokploy/dokploy#6075 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
MongoDB with Replica Sets enabled: container exits with code 0 and restarts in a loop (generated startup script never waits on mongod)Có thể đã có người làm @ghazy2001 đã nhận 10 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Dokploy/dokploy#6051 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Dokploy/dokploy
Issue tương tự
-
status: triage type: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 83/100
WhiteTowerAI/ohmygame#1225 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Add: KBS TV SDĐang mởstreams:add
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
ardia-browser/ardia#5042 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
keycloakify/oidc-spa#211 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày