Build and deploy settings
Every setting that controls how a service is built, started, checked, restarted and sized.
A service's settings decide how Dekka builds it, how it starts, how Dekka knows it's healthy and how much it may use. Open a service on the canvas and choose Settings to change them, then Stage changes and Deploy changes to apply them. Most of them can also come from a dekka.toml or dekka.json in the repository.
Choose a builder
Services from GitHub have three builders under Builder.
- Automatic picks a build for you and works for common Node.js, Python and Go projects.
- Buildpack builds with a Railpack-style buildpack.
- Dockerfile builds the Dockerfile at Dockerfile path, which defaults to
Dockerfilein the root directory.
If the automatic build guesses wrong, set the Build command, such as npm run build, and the Start command, such as npm start or uvicorn app.main:app --host 0.0.0.0 --port $PORT. Empty commands use what Dekka detects.
Deploy only when certain files change
Watch paths lists globs, one per line, such as apps/api/** or packages/shared/**/*.ts. A push deploys the service only when at least one changed file matches one of them, and an empty list means any change deploys it. Globs are matched from the repository root, not the root directory, and a service can have up to 20.
Run migrations before a release
The Pre-deploy command, such as npm run migrate or python manage.py migrate --noinput, runs once before the new release takes traffic.
How does Dekka know my service is healthy?
For a web service, Dekka requests the Health check path on the new release and sends it traffic only after the path returns a 2xx. If that doesn't happen within the Timeout, which defaults to 30 seconds and can be up to 300, the deployment fails and the previous release keeps serving.
What happens when my service crashes?
The Restart policy decides. Restart when it crashes is the default and tries up to the number of Retries, which defaults to 10. Always restart restarts the service whenever it exits, and Never restart leaves it stopped.
Size a service
Under Resources, Replicas sets how many copies run, and vCPU and Memory set the limit for each copy. A new service gets 0.5 vCPU and 256 MiB. Each plan caps these per service.
| Plan | Memory | vCPU | Replicas |
|---|---|---|---|
| Free | 256 MiB | 0.5 | 1 |
| Starter | 512 MiB | 1 | 2 |
| Growth | 1024 MiB | 2 | 4 |
A service with a volume runs one replica.
Sleep when idle
Sleep when idle stops a service when it has no traffic and wakes it on the next request, which can add a few seconds to that request. It's off by default.
Networking settings
A web service's Port is the port it listens on, and Dekka sets PORT to the same value. Public address turns its apps.dekka.cloud address on or off. Your code must listen on 0.0.0.0 rather than localhost, or Dekka can't reach it.
Setting names in the API and config files
In the API, these are fields of a service's spec. A config file uses the same names in its build and runtime sections.
build.strategyis the Builder, one ofauto, which is the default,railpackordockerfile.build.dockerfile_pathis the Dockerfile path,Dockerfileby default.build.build_commandandbuild.start_commandare the commands, detected when empty.build.watch_pathsis a list of globs, empty by default.build.pre_deploy_commandis the Pre-deploy command.runtime.portis the Port,3000by default.runtime.health_check_pathis the Health check path,/by default.runtime.health_check_timeout_secondsis the health check Timeout,30by default.runtime.memory_mib,runtime.vcpuandruntime.replicasare the resources,256,0.5and1by default. vCPU goes in steps of 0.25.runtime.restart_policyison_failure, which is the default,alwaysornever, andruntime.restart_max_retriesis the Retries,10by default.runtime.cron_scheduleis the cron schedule, andruntime.sleep_when_idleisfalseby default.source.root_diris the Root directory,autodeployis Deploy on push, andnetworking.public_domainis Public address. A config file can't set these three.