App Deployment Templates
Commit a .datablock/app.yaml to your repository to predefine your app's build, runtime, and environment configuration — the deploy wizard fills itself in from it.
Overview
When you deploy an app from a git repository, you normally configure the source directory, build settings, ports, and environment variables by hand in the deploy wizard. A deployment template moves that configuration into your repository: commit a .datablock/app.yaml file and the wizard reads it as soon as you select the repository, prefilling every setting it defines.
A template can describe one or more services. Each deploy sets up one service — when a template defines several, the wizard lets you pick which one to deploy, and you run the wizard again for the others.
File Location
The template is looked up on the selected branch, in this order:
.datablock/app.yaml.datablock/app.yml
Example
# .datablock/app.yaml
name: my-platform
region: ams
services:
- name: api
type: service
source_dir: apps/api
build:
strategy: docker
command: bun run build
run_command: bun start
http_port: 8080
internal_port: 3000
instance_size: apps-s-1vcpu-1gb
instances: 2
autodeploy: true
envs:
- key: NODE_ENV
value: production
- key: DATABASE_URL
secret: true # value is filled in the wizard, never committed
- name: web
type: static
source_dir: apps/web
build:
command: bun run build
output_dir: distReference
Top level
| Field | Type | Description |
|---|---|---|
name | string | Optional display name for the template. |
region | string | Optional App Platform region slug (e.g. ams) preselected on the configure step. |
services | list | One or more services (max 10). Required. |
Service
| Field | Type | Description |
|---|---|---|
name | string | Required. Lowercase letters, numbers, and hyphens (max 32 chars). Must be unique within the file. |
type | service | static | Defaults to service. static builds once and serves from CDN. |
source_dir | string | Directory containing the app, for monorepos. Defaults to the repository root. |
build.strategy | nixpacks | buildpacks | docker | How the app is built. Defaults to auto-detection. |
build.command | string | Build command. Leave unset to auto-detect. |
build.output_dir | string | Build output directory. Static sites only. |
run_command | string | Start command. Web services only. |
http_port | number | Public HTTP port. |
internal_port | number | Internal container port. |
instance_size | string | App Platform instance size slug, preselected on the configure step. |
instances | number | Instance count (1–10). |
autodeploy | boolean | Deploy automatically on push to the selected branch. |
envs | list | Environment variables (see below). |
Environment variables
| Field | Type | Description |
|---|---|---|
key | string | Required. Letters, numbers, and underscores, starting with a letter or underscore. |
value | string | The value. Required unless secret: true. |
secret | boolean | Marks the variable as secret. Never commit secret values — leave value unset and the wizard prompts for it, storing it masked. |
Validation
If the template exists but is invalid — malformed YAML, a missing required field, duplicate service names — the wizard shows the validation error and falls back to manual configuration. Nothing is applied from an invalid template.
Values you can still change: everything. The template only prefills the wizard; every setting remains editable before you launch, and settings changed later in the app's dashboard are not overwritten by the file.