feat(compose): support registry images and remote prebuilt deploys - #5159
feat(compose): support registry images and remote prebuilt deploys#5159designly1 wants to merge 6 commits into
Conversation
|
Thanks @greptile-apps — both P1s were valid and are fixed in 38bcee3:
Note: applications already have a similar |
|
Both fixes look correct. Registry ACL ( Log cleanup ( The pre-existing application gap note is fair — it predates this PR and is a separate surface. Both P1s here are properly addressed. Tip: You can customize Greptile's behavior for this repo with |
|
Re-submitted with an additional hardening commit ( What changed since last review:
PR description updated with a Hardening section covering relation disambiguation, delete guardrails, registry org validation, and split build/deploy log cleanup. Validated on gpc3 ( |
|
Re-submitted with Greptile follow-up fixes in Addressed since last review:
Prior hardening commits remain: server-relation disambiguation ( Please re-review. |
e74ffde to
4f73324
Compare
Adds compose registry configuration, build pipeline updates, and migration for stored image metadata. Co-authored-by: Cursor <cursoragent@cursor.com>
Ensure deploy log directories are created on the deploy server when build and deploy run on different hosts, append deploy logs on failure, and prefix chained prebuilt compose commands with `docker compose`. Move onlyBuiltDependencies to pnpm-workspace.yaml per pnpm v10 convention. Co-authored-by: Cursor <cursoragent@cursor.com>
Reject buildRegistryId from other organizations on compose update, and delete deployment logs from buildServerId when present so split build/deploy stacks do not leave orphaned files. Co-authored-by: Cursor <cursoragent@cursor.com>
Name server-side compose relations to match compose.buildServerId and count both deploy-target and build-server references in haveActiveServices so remote server deletion no longer fails with ambiguous Drizzle relations. Co-authored-by: Cursor <cursoragent@cursor.com>
Require compose updates to target a service in the active organization before persisting build registry credentials, and read deployment logs from buildServerId when split compose builds write logs on the build host. Co-authored-by: Cursor <cursoragent@cursor.com>
4f73324 to
e186b91
Compare
|
Rebased onto latest Migration fix: upstream already had Branch is now merge-clean against |
|
Follow-up to get this merge-ready per contributing guidelines:
@Siumauricio — ready for review when you have a chance. Still optional: a short screen recording of the Compose Advanced → Build Server flow would help reviewers (validated manually on gpc3, no recording attached yet). |
|
Demo video (Compose build server + registry, split build/deploy on gpc3): https://cdn.designly.biz/video/dokploy-test-demo.mp4 |
Closes #5224
Summary
pull+up --no-build) when a build server is configured, with registry login on both build and deploy hosts.docker compose.Demo
https://cdn.designly.biz/video/dokploy-test-demo.mp4
Hardening
This feature introduced a second FK from
composetoserver(buildServerId, alongside existingserverId). Several server-management paths were updated to handle that safely:Drizzle relation disambiguation
composeRelationsalready named its two server links (composeServer,composeBuildServer), butserverRelationsstill had an unnamedcompose: many(compose). Any query that loaded a server withwith: { compose: ... }— including remote server delete — failed with:Fix: mirror the application pattern on the server side:
compose→relationName: "composeServer"(deploy target)buildCompose→relationName: "composeBuildServer"(build host)Server delete guardrails
haveActiveServices()now counts both deploy-target and build-server references before allowing deletion:applications+buildApplicationscompose+buildComposePreviously only the deploy-target side was checked. A server used only as a build host could appear deletable (
totalSum === 0in the UI) even while compose stacks still referenced it viabuildServerId.Registry authorization (compose update)
compose.updatenow requires the target compose to belong to the active organization (matchingone/delete) before any fields are persisted. Registry and build-server IDs are then validated against the same active org. This closes the cross-org credential association Greptile flagged whenaccessedServicesspans organizations.Split build/deploy log cleanup and read path
buildServerIdis set, deployment log directories are removed from the build server on cleanup, preventing orphaned log files after split build/deploy runs.deployment.readLogsnow resolves the log host asdeployment.buildServerId || deployment.serverId || …, matching wherecreateDeploymentComposewrites the main log file on split build/deploy runs.Database migration
0188_sharp_arclight.sqladdscompose.buildServerIdandcompose.buildRegistryId(nullable FKs toserverandregistry).canary; upstream already had0187_grant_terminal_permission_to_read_roles.Documentation
Companion docs PR: Dokploy/website#178
Test plan
builddirectives on the same server (no build server) — behavior unchanged--buildpnpm test __test__/compose/create-command-prebuilt.test.tspnpm test __test__/compose/build-compose-command.test.tspnpm test __test__/compose/build-registry-images.test.tsValidated on gpc3 (
ghcr.io/designly1/dokploy:local).