Builds
Build with a buildpack or a Dockerfile, build a monorepo, and see what Clusterz finds in a repository.
A service is built in one of two ways.
- Buildpack. Clusterz reads your code and builds it without a Dockerfile.
build_commandis the npm scripts to run, likenpm run build, andstart_commandstarts the service. - Dockerfile. Clusterz builds the Dockerfile you name.
dockerfileis its path fromroot.
Monorepos
A service lives in a folder, root, and the build reads that folder only. Both build methods honour it, so api/ and web/ of one repository are built separately, as two services of one app.
What Clusterz finds
With no clusterz.yaml, Clusterz reads the repository in this order:
- A
docker-compose.ymlorcompose.yaml. Each service with a build becomes a service, and a Postgres or Redis service becomes the app's database instead of a container. - A
Procfile.webis the service,releaseis the release command, and every other process is a worker. - npm, yarn and pnpm workspaces, Turborepo and Nx.
- A folder with its own Dockerfile,
package.json,go.mod,pyproject.toml,requirements.txt,Gemfileorcomposer.json.
From the framework it takes the start command, the port and the release command. Prisma, Django, Alembic, Rails and Laravel migrations are recognised.
Build-time variables
A variable marked at_build reaches the build as well as the running service: buildpacks read it as an environment variable, and a Dockerfile as an ARG it declares. Use it for values built into the app, like NEXT_PUBLIC_SITE_URL. The build log masks a value of four characters or more.
cluz env set NEXT_PUBLIC_SITE_URL=https://shop.example.com --buildChange a setting without the file
cluz projects update --root api --dockerfile api/Dockerfile --release-command "npm run migrate"This changes the folder, the Dockerfile and the commands of an app that exists. Pass an empty value to clear a command, and --auto-deploy=false to stop pushes from deploying.