How detection works
When Mangrove reads a repository, it takes the first match:- A
docker-compose.yml,docker-compose.yaml,compose.ymlorcompose.yaml→ Docker Compose. - A
Dockerfile→ Dockerfile, with the port taken from its lastEXPOSE. - An
index.htmland nopackage.json→ Static site, no build step. - A
package.jsonwhose build has no start command (a frontend that only builds files) → Static site, with nixpacks’ build command and output directory. - Anything else → Nixpacks.
Common settings
- Root path: the subdirectory to build from, for monorepos. Defaults to the repository root.
- Branch: which branch to build. Pushes to it redeploy when auto-deploy is on.
- Dockerfile path / Compose file path: if not at the default location.
Dockerfile
Mangrove runsdocker build with your Dockerfile and tags the image
mangrove/<slug>-<service>:<run>. A multi-stage Dockerfile builds its last
stage.
Nixpacks
Nixpacks detects the language and builds an image with no Dockerfile. It must be installed on the box (nixpacks on the
PATH).
Two settings are always passed to nixpacks builds:
NIXPACKS_NODE_VERSION=22, because the last nixpacks release defaults to Node 18, which no longer installs.NODE_OPTIONS=--max-old-space-size=1536, which caps Node’s heap so a large build fails with a clear error instead of being killed by the kernel.
Static site
Caddy serves the files directly. There’s no container, so there are no logs, replicas or health checks.- No build command: Mangrove copies the output directory (or the whole repo) as-is.
- With a build command (such as
npm run build): Mangrove builds with nixpacks, copies the output directory (such asdist) out of the result, and throws the builder image away.
/var/lib/mangrove-static, so rolling back just points Caddy at an earlier
folder.
Build-time variables
A deployment’s variables are given to the running container, not to the build. Dockerfile builds get no--build-args and nixpacks builds get no extra --envs. If a build step
needs a value (a public API URL baked into a frontend, say), put it in the
repository or a Dockerfile ARG default.
Compose stacks don’t receive Mangrove’s variables at all; configure them
in the compose file or an .env file in the repository. See
Compose stacks.