Skip to content

feat(api): declarative container command/entrypoint + file injection - #144

Merged
caiopizzol merged 1 commit into
mainfrom
caiopizzol/declarative-container-config
Jun 12, 2026
Merged

feat(api): declarative container command/entrypoint + file injection#144
caiopizzol merged 1 commit into
mainfrom
caiopizzol/declarative-container-config

Conversation

@caiopizzol

Copy link
Copy Markdown
Owner

Lets a project set its container command/entrypoint and inject files without anyone opening the VM or running docker by hand. Today changing either means ssh-ing in or baking a one-off Dockerfile; this moves both into the declarative project model, alongside env and volumes.

  • command/entrypoint thread from the deploy API and the moor_deploy MCP into the Docker create body, and are set only when provided so existing image-default behavior is unchanged.
  • files ({path, content, mode}) are written into the container via a tar archive PUT right before start, on every (re)create, honoring the file mode in the tar header. The tar writer is hand-rolled (one ustar entry per file) to stay dependency-free.

The case that motivated it: running cloudflare/cloudflared with command [tunnel, run] plus a TUNNEL_TOKEN env and an injected TLS cert, with no repo Dockerfile and no ssh.

Verified: bunx biome check, tsc -p apps/api/tsconfig.json, and bun test all pass; new tests cover the create body (Cmd/Entrypoint present only when set) and the archive-before-start ordering with the file mode.

Projects can set a container command/entrypoint and inject files without VM or Docker access.

- command/entrypoint thread through the deploy API and moor_deploy MCP into the
  Docker create body, set only when provided (image defaults unchanged otherwise).
- files ({path, content, mode}) are written into the container via a tar archive
  PUT before start, on every (re)create, honoring the mode in the tar header.

Motivating case: run cloudflare/cloudflared with command [tunnel, run] + a
TUNNEL_TOKEN env and an injected TLS cert, with zero repo Dockerfile and zero ssh.
@caiopizzol
caiopizzol merged commit 2e8822a into main Jun 12, 2026
3 checks passed
@caiopizzol
caiopizzol deleted the caiopizzol/declarative-container-config branch June 12, 2026 19:30
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.

1 participant