Platform

cluster.toml reference

Keys, types, defaults, and examples for Serverless Apps and Compute services.

View as Markdown

Commit cluster.toml at the project root so every clone uses the same build and service settings. An App uses [serverless]. A Compute service uses the top-level name and mode keys plus its service tables. Both can share a file. CCP keeps the selected remote identities in the gitignored .ccp/ directory. See the quickstart to link a fresh clone.

Serverless App

[serverless]
index = "src/handler.ts"
client = "src/client.tsx"
assets = "public"
analytics = "server"
oidc_callback_path = "/auth/callback"
KeyTypeDefault when omittedMeaning
indexstringRequired in this tableEntry file exporting the request handler.
clientstringNo browser entryClient-side JavaScript or TypeScript entry to bundle.
assetsstringNo configured assets directoryDirectory of static files to include.
analyticsstring"server"Select "server" for server-side analytics or "client" for browser tracking.
prebuilt_assetsbooleanfalseRead HTML only from the assets directory. Requires assets. Used for compiled frontend output such as Vite’s dist. CCP serves this HTML unchanged, so add any analytics script yourself.
oidc_callback_pathstring"/auth/callback"Callback path used when CCP registers a redirect URI for a linked OIDC client.

Use project-relative paths that resolve inside the project for index, client, and assets. Omit optional paths you do not use.

Local development

KeyTypeDefault when omittedMeaning
dev.env_filestringAutomatic .env discoveryDefault environment file for ccp dev only.

Use a non-empty path relative to the project root. It must resolve to an existing file inside the project, even if the path uses a symlink. If CCP can't load the configured file, ccp dev exits with an error rather than falling back to .env. See Custom Env File for an example and command-line overrides.

Compute service

This image-mode example runs NGINX on port 80. Put the two top-level keys before the first table header.

name = "web"
mode = "image"

[image]
ref = "nginx:alpine"

[service]
internal_port = 80
always_on = false
KeyTypeDefault when omittedMeaning
namestringRequired in a Compute manifestService name.
modestringRequired"image" pulls a container image. "binary" runs a Linux x86-64 executable.
image.refstringRequired for image modeContainer image reference.
service.internal_portintegerRequiredPort the service listens on, from 1 to 65535. Bind the application to 0.0.0.0 so the proxy can reach it.
service.always_onbooleanfalseSet to true to keep the VM running and to enable private network attachment.

Changing the mode, binary runtime, port, resource shape, always-on setting, or network can require replacing a deployed service. See Compute replacement.

Binary and build

For a binary service, use mode = "binary" and supply a binary table. CCP records a build table when it detects a Go or Rust source project.

name = "worker"
mode = "binary"

[binary]
path = "./dist/worker"
runtime = "auto"
args = ["--listen", "0.0.0.0:8080"]

[service]
internal_port = 8080
[build]
kind = "go"
KeyTypeDefault when omittedMeaning
binary.pathstringRequired for a prebuilt binary. A source-only [build] can omit the binary table.Path to the executable CCP uploads.
binary.runtimestring"auto"CCP inspects the ELF to select Alpine for static or musl binaries and Debian for glibc. Set "alpine" or "debian" to select explicitly.
binary.argsarray of strings[]Each element is one argument. CCP passes the arguments without shell expansion.
build.kindstringNo recorded build toolchain"go" or "rust". CCP uses the recorded toolchain to rebuild from source on redeploy. Omit the table when supplying a prebuilt binary.

Resources and environment

[resources]
vcpu = 2
memory_mb = 1024

[env]
LOG_LEVEL = "info"
KeyTypeDefault when omittedMeaning
resources.vcpuinteger1 when the table is absentVirtual CPUs. Supply both resource keys when setting a shape.
resources.memory_mbinteger512 MiB for binary mode, 768 MiB for image mode when the table is absentMemory in MiB. Supported explicit CPU/memory pairs are 1/256, 1/512, 2/1024, 4/2048, and 4/4096.
env.<KEY>stringNo manifest valueCompute environment variable. Values from this table override .env; a deploy-time --env overrides both. Keep credentials out of the committed file.

Health checks

Omit [health] for the standard TCP readiness check. Add the table when readiness depends on an HTTP endpoint.

[health]
path = "/ready"
port = 8080
initial_delay_ms = 1000
timeout_ms = 2000
period_ms = 500
success_threshold = 1
startup_budget_ms = 30000
Key in [health]TypeDefault when omittedMeaning
pathstringRequiredHTTP readiness path served by your application.
portintegerservice.internal_portPort serving the readiness endpoint.
initial_delay_msinteger1000Delay before retries if the initial HTTP probe fails, in milliseconds.
timeout_msinteger2000Timeout per probe, in milliseconds.
period_msinteger500Interval between attempts, in milliseconds.
success_thresholdinteger1Consecutive successes required during retries. An immediately successful first probe passes.
startup_budget_msinteger30000Retry budget after the initial delay, in milliseconds.

Private network

[network]
name = "backend"

network.name is a string, required when the table is present. Use a lowercase DNS label of 1–63 letters, digits, or hyphens, starting and ending with a letter or digit. Omitting the table selects no private network. For a Serverless App, select an existing network in the organization. For Compute, set service.always_on = true; the first deploy can create the network. See Compute networking and App deployment.

On this page