Docker Configuration
Running CodeSpar with Docker, including Dockerfile details, Docker Compose configurations for minimal and full deployments, channel-specific overrides, and volume mounts.
Docker Configuration
CodeSpar ships with Docker configurations for development and production deployments. The Docker setup uses multi-stage builds for minimal image size and includes Compose files for different deployment scenarios.
Dockerfile
CodeSpar uses a multi-stage Node.js 22 Alpine build for small, secure images.
Image Details
| Property | Value |
|---|---|
| Base image | node:22-alpine |
| Final image size | ~180 MB |
| User | codespar (non-root, UID 1001) |
| Working directory | /app |
| Storage directory | /app/.codespar |
| Default port | 3000 |
Docker Compose — Base
The base docker-compose.yml runs CodeSpar with minimal configuration:
Running
Docker Compose — Full Stack
The docker-compose.full.yml includes all supporting services: PostgreSQL, Redis, and the Evolution API for WhatsApp.
Running the Full Stack
Channel-Specific Overrides
You can create override files for specific channel combinations.
Slack Only
Discord Only
Multiple Channels
Volume Mounts
The .codespar directory contains all persistent state. It must be mounted as a volume in production to survive container restarts.
| Volume | Container Path | Description |
|---|---|---|
codespar-data | /app/.codespar | Agent state, audit logs, vector store, project configs |
postgres-data | /var/lib/postgresql/data | PostgreSQL data (full stack only) |
redis-data | /data | Redis persistence (full stack only) |
evolution-data | /evolution/instances | Evolution API WhatsApp sessions |
Backup
To back up the CodeSpar data volume:
Building the Image
Health Check
Add a health check to your container:
Next Steps
- Railway Deployment — Deploy to Railway
- Configuration — All environment variables
- Security — RBAC and audit configuration