Skip to content

docs(deploy): document cwd, monorepo Dockerfile pattern, GIT-template caveat#56

Open
marvin-69-jpg wants to merge 1 commit into
zeabur:mainfrom
marvin-69-jpg:fix/deploy-monorepo-cwd-zbpack
Open

docs(deploy): document cwd, monorepo Dockerfile pattern, GIT-template caveat#56
marvin-69-jpg wants to merge 1 commit into
zeabur:mainfrom
marvin-69-jpg:fix/deploy-monorepo-cwd-zbpack

Conversation

@marvin-69-jpg
Copy link
Copy Markdown

@marvin-69-jpg marvin-69-jpg commented Apr 26, 2026

Summary

Adds five gotchas observed while deploying a Python uv-workspace monorepo (apps/api + apps/jobs with separate Dockerfiles under infra/zeabur/) to Zeabur via the CLI:

  1. Direct deploy must run from the workspace root. zeabur deploy tars the current working directory; running from a subdir produces a tarball missing files the Dockerfile expects. Easy to miss after cd-ing into a subdir for testing.

  2. Monorepo with multiple Dockerfiles: set per-service env var ZBPACK_DOCKERFILE_PATH (e.g. infra/zeabur/api.Dockerfile) instead of swapping a root zbpack.json between deploys. Env vars take precedence over zbpack.json (per zbpack source: pkg/plan/config.go env-var lookup runs before zbpack.json), so each service's redeploy works with no config swap.

  3. zbpack.json schema is nested, not flat. {\"dockerfile\": {\"path\": \"...\"}} works; {\"dockerfile\": \"...\"} is silently ignored and zbpack falls back to language autodetection (planType=python, etc.). The flat form is what most users guess on first try.

  4. service deploy --template GIT --repo-id ... --branch-name ... is broken in non-interactive mode (observed 2026-04 against CLI 0.15.0): the command returns success, but the resulting service is Template=PREBUILT_V2 with Status=SUSPENDED and GitTrigger=null — the Git source is NOT actually wired. service redeploy then errors with Internal Server Error. Direct deploy is the working path.

  5. Tips additions: don't retry a hung deploy without checking service list first (the upload may already be in flight; retrying creates a duplicate service with a numeric/letter suffix appended to the requested --name); verify planType=docker in the latest deployment after a Dockerfile-based deploy — if it shows python/nodejs/etc., zbpack didn't find your Dockerfile.

Context

I hit each of these in sequence during a real session deploying a Postgres+Redis-backed FastAPI/uv-workspace monorepo to a fresh Zeabur project. The skill's existing direct-deploy section is good for the simple-app case but is silent on monorepos and on the service deploy --template GIT failure mode, which led to multiple wrongly-created services and ~30 min of CLI flailing before reading zbpack source.

Test plan

  • Direct deploy from workspace root with ZBPACK_DOCKERFILE_PATH set per service: verified planType=docker and the right Dockerfile is built (api at infra/zeabur/api.Dockerfile, jobs at infra/zeabur/jobs.Dockerfile)
  • Verified flat {\"dockerfile\": \"...\"} zbpack.json is ignored (build went python plan); nested {\"dockerfile\": {\"path\": \"...\"}} works
  • Reproduced the service deploy --template GIT SUSPENDED-PREBUILT_V2 result, confirmed GitTrigger=null and service redeploy Internal Server Error
  • Reproduced duplicate-service creation when retrying a hung zeabur deploy --name api (got api and api-toops services)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Expanded deployment documentation with workspace configuration requirements for multi-service setups
    • Added operational troubleshooting guidance for deployment verification
    • Documented known Git Deploy limitations affecting automatic redeploys

… caveat

Adds five gotchas observed deploying a Python uv-workspace monorepo
(api + jobs services with separate Dockerfiles in infra/zeabur/) to
Zeabur:

- Direct deploy must run from the workspace root. zeabur deploy tars
  the cwd; running from a subdir produces a tarball that's missing
  the files the Dockerfile expects to COPY.

- Monorepo with multiple Dockerfiles: set per-service env var
  ZBPACK_DOCKERFILE_PATH instead of swapping a root zbpack.json
  between deploys. Env vars take precedence over zbpack.json so each
  service's redeploy "just works" with no config swap.

- zbpack.json schema is nested, not flat. {"dockerfile": {"path": "..."}}
  works; {"dockerfile": "..."} is silently ignored and zbpack falls
  back to language autodetection (planType=python etc.).

- service deploy --template GIT --repo-id ... --branch-name ...
  accepts the flags and returns success, but creates a SUSPENDED
  PREBUILT_V2 service with GitTrigger=null — Git source not actually
  wired, redeploy errors with Internal Server Error. Direct deploy is
  the working path.

- Tips: don't retry a hung deploy without checking service list first
  (creates duplicates); verify planType=docker after a Dockerfile-based
  deploy.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 26, 2026

Walkthrough

Documentation updates to the Zeabur deployment skill guide, adding requirements for monorepo deployments from workspace root, multi-Dockerfile configuration guidance using ZBPACK_DOCKERFILE_PATH, documented Git Deploy limitations, and operational best practices for duplicate service avoidance and deployment verification.

Changes

Cohort / File(s) Summary
Zeabur Deploy Documentation
skills/zeabur-deploy/SKILL.md
Added monorepo deployment requirements (workspace root execution), multi-Dockerfile configuration guidance with ZBPACK_DOCKERFILE_PATH and zbpack.json schema details, Git Deploy trigger limitation note, and operational tips for service duplication and build type verification.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically summarizes the main documentation additions: working directory requirement, monorepo Dockerfile pattern guidance, and Git template caveat. It is concise and clear.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@skills/zeabur-deploy/SKILL.md`:
- Around line 49-50: Update all inline CLI mentions in SKILL.md to use the
required entry point `npx zeabur@latest` instead of bare commands: replace
occurrences like "zeabur deploy" with "npx zeabur@latest deploy" and "service
deploy" with "npx zeabur@latest service deploy". Target the paragraph headed
"Run from the workspace root." (the sentence referencing `zeabur deploy`) and
also update the other occurrences called out in the review (the mentions around
lines 116-117 and 181-182) so every inline command reference uses `npx
zeabur@latest`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b93d41b6-90b0-4390-9370-b9280d4d7d91

📥 Commits

Reviewing files that changed from the base of the PR and between 78b02c1 and feaef7f.

📒 Files selected for processing (1)
  • skills/zeabur-deploy/SKILL.md

Comment on lines +49 to +50
> **Run from the workspace root.** `zeabur deploy` tars the current working directory; if you are in a subdirectory the tarball will be missing files the build needs. For monorepos, this means `cd` to the repo root before deploying — even when deploying a single service. The tarball respects `.dockerignore` for excluding files like `.venv`, `node_modules`, nested git repos.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Standardize all inline command references to npx zeabur@latest

These lines still show bare CLI forms (zeabur deploy, service deploy). Please rewrite inline command mentions to the required entry point (for example, npx zeabur@latest deploy ... and npx zeabur@latest service deploy ...) so the guidance is fully consistent.

As per coding guidelines, “All skills must use npx zeabur@latest as the CLI entry point in their CLI commands.”

Also applies to: 116-117, 181-182

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@skills/zeabur-deploy/SKILL.md` around lines 49 - 50, Update all inline CLI
mentions in SKILL.md to use the required entry point `npx zeabur@latest` instead
of bare commands: replace occurrences like "zeabur deploy" with "npx
zeabur@latest deploy" and "service deploy" with "npx zeabur@latest service
deploy". Target the paragraph headed "Run from the workspace root." (the
sentence referencing `zeabur deploy`) and also update the other occurrences
called out in the review (the mentions around lines 116-117 and 181-182) so
every inline command reference uses `npx zeabur@latest`.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants