Skip to content

feat: add Deploy with Fresh Volumes for Docker Compose#4195

Open
lamualfa wants to merge 2 commits intoDokploy:canaryfrom
lamualfa:feat/compose-deploy-fresh-volumes
Open

feat: add Deploy with Fresh Volumes for Docker Compose#4195
lamualfa wants to merge 2 commits intoDokploy:canaryfrom
lamualfa:feat/compose-deploy-fresh-volumes

Conversation

@lamualfa
Copy link
Copy Markdown

@lamualfa lamualfa commented Apr 10, 2026

Summary

  • Adds a "Fresh Volumes" button next to the existing Deploy button in the Compose UI
  • When triggered, runs docker compose down --volumes before the standard deploy step, ensuring a clean state
  • Only available for docker-compose type projects (not swarm stacks)
  • Uses a destructive confirmation dialog to prevent accidental data loss

Closes #4194

Changes

Backend:

  • Added freshVolumes optional boolean to apiDeployCompose and apiRedeployCompose API schemas
  • Added freshVolumes to DeploymentJob type for queue propagation
  • Updated deployCompose() and rebuildCompose() services to run docker compose down --volumes when freshVolumes is true
  • Updated queue worker and API router to pass freshVolumes through the pipeline

Frontend:

  • Added "Fresh Volumes" button with HardDriveDownload icon in compose actions
  • Button uses destructive dialog confirmation warning about permanent data loss
  • Only rendered for docker-compose type (hidden for stack type)

Test plan

  • Create a docker-compose project with volumes
  • Deploy it normally, verify volumes are created
  • Click "Fresh Volumes" button and confirm
  • Verify the deployment log shows docker compose down --volumes before the build
  • Verify volumes are removed and recreated
  • Verify the button does not appear for stack-type compose projects
  • Verify existing Deploy and Reload buttons still work as before
  • Test with remote server deployment

Greptile Summary

This PR adds a "Fresh Volumes" deploy button for docker-compose projects that runs docker compose down --volumes before a full redeploy, giving users a clean-slate deployment option with a destructive confirmation guard. The feature is end-to-end wired correctly through the schema, queue types, worker, router, and UI, with appropriate backend enforcement (composeType === "docker-compose" check in the service layer).

Confidence Score: 5/5

Safe to merge — only a minor stylistic inconsistency remains.

All findings are P2 (style/consistency). The one issue is that the new docker compose down --volumes commands omit the env -i PATH=$PATH prefix that every other docker compose invocation in the file uses, which is inconsistent but not a correctness or security problem. Logic, permissions, queue propagation, UI gating, and destructive-action confirmation are all correctly implemented.

packages/server/src/services/compose.ts — lines 272 and 398 should add env -i PATH=$PATH for consistency.

Reviews (1): Last reviewed commit: "feat: add "Deploy with Fresh Volumes" bu..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

Adds a one-click option to redeploy Docker Compose services with clean
volumes, removing the need to manually edit the run command.

When triggered, it runs `docker compose down --volumes` before the
standard deploy build step. The feature is only available for
docker-compose type projects (not swarm stacks).
@lamualfa lamualfa requested a review from Siumauricio as a code owner April 10, 2026 09:19
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. enhancement New feature or request labels Apr 10, 2026
Comment thread packages/server/src/services/compose.ts Outdated
Consistent with the rest of the codebase where every docker compose
invocation uses `env -i PATH="$PATH"` for a clean environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add "Deploy with Fresh Volumes" / Reset button for Docker Compose projects

1 participant