Deployment
Docker
The included Dockerfile is multi-stage:
- Build stage — PDM exports production dependencies to
requirements.txtfrompyproject.toml/pdm.lock. - Runtime stage —
pip install -r requirements.txt, copysrc/andLICENSE, run as non-root userappuser.
Default command:
CMD ["python", "src"]
The image does not bake in config.yaml. Provide configuration at runtime:
- Mount
config.yml/config.yaml, or - Inject
BOTKIT__…environment variables (see Configuration)
Generate env lines from a local YAML file before deploy:
pdm run convert-config -i config.yaml --terminal
Process layout (use, cache, REST mode) is covered in Configuration.
Environment-first deploys
Platforms without persistent volumes (Docker Swarm, some PaaS) often prefer env-only config. Merge order means env overrides file — you can ship a minimal file plus secrets as env vars.
Required minimum:
BOTKIT__bot__token=…
BOTKIT__use__bot=true
Health and observability
- Use extension HTTP routes (e.g. bundled
/pingwhen ping's backend is enabled) or your ownsetup_webserverroutes for load balancer checks. - Enable
logging.file: trueand mountlogging.directoryif you need log persistence on disk. - Sentry can be integrated in extensions (bundled nice-errors patches error paths when enabled).
What ships in the image
Production export includes runtime Python dependencies only — not dev tools (pytest, ruff, zensical). Build and test in CI or locally before pushing the image.