Deployment¶
ChaCC API can run as a Docker container, as part of Docker Compose, or as a standalone Linux service.
Docker¶
Build and run a local image:
docker build -f deployment/docker/Dockerfile -t chacc-api:latest .
docker run -d -p 8080:8080 chacc-api:latest
The Docker image installs chacc-api from PyPI and starts the server with:
Docker Compose¶
Use the production compose file here:
The compose stack includes:
- ChaCC API on port
8085. - PostgreSQL 15.
- Persistent PostgreSQL data volume.
- Persistent module storage volumes.
- Health checks for API and database readiness.
Example environment:
DB_PASSWORD=change-me
SECRET_KEY=replace-with-a-strong-random-secret
ADMIN_PASSWORD=replace-with-a-strong-admin-password
Standalone Linux deployment¶
A deployment script is provided at deployment/standalone/deploy.sh.
The script:
- Creates the
chacc-apiuser. - Installs Python 3 if needed.
- Creates a virtual environment under
/opt/chacc-api. - Installs
chacc-apifrom PyPI. - Writes a production
.envfile. - Installs a systemd service.
- Starts the service.
Access the API at:
Check service logs:
Health checks¶
| Endpoint | Use |
|---|---|
/health |
Basic service health. |
/health/ready |
Readiness including database connectivity. |
/health/live |
Lightweight process liveness. |
Container health checks can call:
Production environment¶
Recommended production settings:
CHACC_DEV_MODE=false
DATABASE_ENGINE=postgresql
DATABASE_HOST=localhost
DATABASE_PORT=5432
DATABASE_USER=chacc
DATABASE_NAME=chacc
DATABASE_PASSWORD=<strong-password>
SECRET_KEY=<random-32-plus-character-secret>
ENABLE_PLUGIN_HOT_RELOAD=false
PLUGIN_AUTO_DISCOVERY=false
ENABLE_PLUGIN_DEPENDENCY_RESOLUTION=false
MIGRATION_MODE=auto
MIGRATION_BACKUP=true
MIGRATION_BACKUP_DIR=backups
LOG_LEVEL=INFO
Module persistence¶
In containerized deployments, persist these directories if modules are installed at runtime:
.modules_installed/.modules_loaded/.chacc_cache/backups/
Without persistence, installed modules may be lost when the container is recreated.