Configuration
The autodisc.yml reference and runtime detection.
Autodisc reads an optional autodisc.yml from the root of your project. If it's missing, Autodisc falls back to runtime detection (Dockerfile → package.json → requirements.txt / pyproject.toml). Use autodisc.yml when auto-detection picks the wrong runtime, command, or port.
Minimal example
run: npm start
env:
NODE_ENV: productionThat's enough for most Node and Python projects.
Top-level fields
All fields are optional.
| Field | Type | Description |
|---|---|---|
run | string | Start command. Runs after build. Alias: command. |
build | string or string[] | Commands that run before run. A list runs in order. |
runtime | string | Runtime hint (node, python, dockerfile, etc.). Used when no image or Dockerfile is specified. |
image | string | Explicit container image, e.g. node:20-slim. Overrides runtime detection. |
dockerfile | relative path | Path to a Dockerfile, relative to the repo root. Picking this takes precedence over image/runtime. |
workdir | relative path | Working directory inside the container. Must be relative and cannot escape the project root. |
env | map of string→string | Non-secret environment defaults. Do not put secrets here — use dashboard env vars. |
port | integer | Port your app listens on. Autodisc exposes this port publicly for your server. |
internal | boolean | If true, the service is reachable only from sibling services, not from the internet. |
routes | list | Route bindings (host and optional path). See Routes. |
services | map | Multi-service config. See Multi-service. |
A fuller example
runtime: node
image: node:20-slim
workdir: app
build:
- npm ci
- npm run build
run: node dist/server.js
env:
NODE_ENV: production
PORT: "3000"
port: 3000Rules worth knowing:
buildcommands andrunare joined with&&when executed, so a failed build command stops the deploy.- Relative paths (
dockerfile,workdir) cannot start with/or contain... envvalues are coerced to strings — quote numbers ("3000") to avoid YAML surprises.- If neither
run,build, nor an image is set, Autodisc falls back to runtime detection for that field.
Routes
Routes map external hostnames to a service. The shorthand form is a host string; the full form lets you restrict by path.
routes:
- example.com
- host: api.example.com
path: /v1hostis required;pathdefaults to/.pathmust start with/.- Paths are matched as prefixes.
Domain routing is still being polished — see Troubleshooting if a custom host doesn't resolve.
Multi-service
For projects with more than one process (web + worker, API + scheduler, etc.), use services. Each service is a full config and inherits nothing from the top level except env (service env is merged over the top-level env).
env:
NODE_ENV: production
services:
web:
run: node dist/server.js
port: 3000
routes:
- example.com
worker:
run: node dist/worker.js
internal: true
depends_on:
- webField notes:
- Service names must be non-empty strings.
- If a service named
webexists, it's treated as the primary service for routing defaults. depends_onis a list of other service names that should start first.internal: truekeeps the service off the public network.- When
servicesis omitted, Autodisc creates a single implicit service calledappfrom the top-level fields.
Runtime detection
When no autodisc.yml is present, Autodisc inspects your repo:
| File | Runtime | Default start |
|---|---|---|
Dockerfile | Docker | (from Dockerfile) |
package.json | Node | npm start |
requirements.txt / pyproject.toml | Python | python main.py |
If detection is wrong — or if you want an explicit, reviewable setup — add autodisc.yml.
Secrets
Secrets belong in the dashboard's environment variables panel, not in autodisc.yml. The config file is committed to your repo; anything written in env: becomes part of your source history.