Custom Builds

Temps builds apps with Autopack, its built-in builder, and doesn't run Heroku or Paketo buildpacks. To change how an app builds, add an autopack.json (system packages, runtime versions, install, build and start commands), set build commands in .temps.yaml, or bring your own Dockerfile. An existing nixpacks.toml or railpack.json still works as a fallback.


How build detection works

Temps offers presets from the files in your repository: a Compose file, a Dockerfile, framework config files such as next.config.*, language manifests such as composer.json, Gemfile, go.mod or Cargo.toml, a nixpacks.toml, and finally an index.html if nothing else matched. A plain package.json isn't a signal, so an Express, NestJS, Astro or Nuxt app needs the Autopack (Node.js) preset (nixpacks-node) chosen on the project. The presets are listed in How framework detection works.

Which builder runs depends on the preset:

  • autopack, nixpacks, nixpacks-*, python, go, rust, java: build with Autopack, and read the files on this page.
  • nextjs, vite, react-app, rsbuild, docusaurus: use Temps' own generated Dockerfile. They honour the .temps.yaml build commands but don't read autopack.json, railpack.json or nixpacks.toml.
  • nixpacks-static: has no build step.

autopack.json

Put an autopack.json in the app directory:

autopack.json

{
  "packages": { "node": "22" },
  "aptPackages": ["libvips-dev"],
  "deployAptPackages": ["ffmpeg", "imagemagick"],
  "steps": {
    "build": { "commands": ["...", "npm run build:docs"] }
  },
  "deploy": { "startCommand": "node dist/server.js" }
}
KeyWhat it does
packagesRuntime versions, for example { "node": "22" }
aptPackagesDebian packages in the build image only
deployAptPackagesDebian packages in the running container. Use this for tools your app runs, such as ffmpeg
steps.<name>.commandsReplaces the commands of a step (install, build). "..." keeps the commands Autopack generated
deploy.startCommandReplaces the start command
deploy.variablesVariables set in the running container
providerForces a language provider, only under the autopack and nixpacks presets; a language-specific preset wins
excludeExtra paths left out of the build context

An unknown key fails the build with an error naming it. A web: line in a Procfile also sets the start command, and deploy.startCommand wins over it. Temps runs only the web process, so other Procfile lines and deploy.tasks aren't run.


Order of precedence

  1. A Dockerfile in the project directory is used, and nothing else on this page applies.
  2. Only one config file is read: autopack.json, else railpack.json, else nixpacks.toml. They aren't merged.
  3. .temps.yaml build commands and the project's build settings win over the config file's install and build commands.
  4. A language-specific preset wins over provider.
  5. The start command comes from the config file, then a Procfile web: line, then the framework default.

Build commands in .temps.yaml

.temps.yaml in the app directory can override the install command, the build command and the output directory. Keys are in snake_case:

.temps.yaml

build:
  install_command: pnpm install --frozen-lockfile
  output_dir: dist/my-app/browser

On an Autopack preset, output_dir makes a Node.js app a static site.

Project environment variables don't configure Autopack: setting AUTOPACK_APT_PACKAGES or AUTOPACK_START_CMD on a project does nothing. Use autopack.json.


nixpacks.toml and railpack.json

The nixpacks-* presets keep their names, but since August 2026 Temps builds them with Autopack, not the Nixpacks binary. If there is no autopack.json, Autopack reads a railpack.json or nixpacks.toml in the app directory and translates the parts that have an equivalent. A railpack.json alone doesn't trigger detection, so choose the autopack preset to use one.

nixpacks.toml settingWhat Autopack does with it
aptPkgsInstalls the Debian packages in the build image only; the running container doesn't get them
nixPkgsRuntimes only (nodejs_22, python311, go_1_23, …) set the language version. Other Nix packages aren't installed, and the build log shows a warning
[phases.install] and [phases.build] cmdsReplace the install and build commands. "..." keeps the generated ones
[phases.setup] cmdsNot run, with no warning
Other phasesNot run; the build log shows a warning
[start] cmdReplaces the start command
[variables]Set in the running container, not during the build
providersThe first one forces the language provider, only under the autopack and nixpacks presets

Other keys in the file are ignored without a warning. For tools your app runs, such as ffmpeg, move to deployAptPackages in autopack.json.

From railpack.json, Autopack reads provider, packages, buildAptPackages, steps (commands, inputs, assets, variables, caches), caches, exclude and deploy (startCommand, aptPackages, variables, paths, inputs, base).


Dockerfile

A Dockerfile gives you complete control over the build and the runtime image. Its path and build context are project settings. Multi-stage builds, build arguments and layer caching are covered in Deploy Docker Containers:


Build caching

Temps builds with BuildKit, which keeps Docker layers between builds, and Autopack builds add cache mounts for package-manager downloads (for example the Cargo registry and target/ for Rust). Cache mounts are scoped to the project, environment and branch or tag, so the first build of a new branch starts cold. Order your own Dockerfiles so dependency installs come before COPY . ., as shown in Build caching.

There is no per-project button to clear the cache. To force a clean build, run docker builder prune --all on the server, which clears the build cache for every project, then deploy again.


Build resources

Temps builds through the Docker Engine API with BuildKit on Docker 18.09 and later. BuildKit ignores per-build CPU and memory options, so builds there aren't capped. On Docker's legacy builder, the default is half the host's CPUs (at least 2) and half its RAM (at least 2 GiB, and at most 2047 MB as sent). Autopack builds need BuildKit.


Control-plane build limits

Operators can cap how many image builds run at once on the control plane. On Docker's legacy builder they can also cap each build's CPU and memory; BuildKit ignores those two caps.

Configure these in the console under Settings → Infrastructure → Build Limits (route /settings/build-limits). Three knobs are available:

SettingFieldDefaultRangeEffect
Max concurrent buildsmax_concurrent21–32How many image builds run at once. Extra builds queue rather than fail.
CPU per build (cores)cpu_limit_cores0.00–64Legacy builder only; ignored by BuildKit. 0 = half the host's CPUs, at least 2.
Memory per build (MB)memory_limit_mb00–262144Legacy builder only; ignored by BuildKit. Values above 2047 MB are reduced to 2047 MB. 0 = half the host's RAM (at least 2 GiB), reduced the same way.

On the legacy builder, the resource caps only take effect when both cpu_limit_cores and memory_limit_mb are greater than 0; if either is 0, both fall back to the default. If both are set on a BuildKit host, Temps logs a warning at startup, and only the concurrency limit applies.

Queuing, not failing. A process-wide semaphore inside the build runtime gates every build to max_concurrent permits. When all slots are in use, additional builds wait for a free slot rather than erroring, and the build log stream shows:

[BUILD QUEUED] Waiting for an available build slot...

On the legacy builder, Temps' Docker API client sends the memory cap as a 32-bit value, so anything above 2047 MB is reduced to 2047 MB, with a warning in the server log. BuildKit ignores the value.

When changes take effect

All three settings are read once at startup, so changes take effect after temps serve restarts.

Worker nodes are not limited

These limits apply to the control plane only. Worker nodes (joined with temps join and run with temps agent) don't use them, so builds there aren't queued.

Last updated

Was this page helpful?