Docker Deployment
ChatterMate can be deployed using Docker in both development and production environments.Development Setup
For local development, we usedocker-compose.yml which sets up:
- Frontend (Vue.js) with hot-reloading
- Backend (FastAPI) with auto-reload
- PostgreSQL with pgvector extension
- Redis for caching and rate limiting
Prerequisites
- Docker
- Docker Compose
- Git
Quick Start
- Clone the repository:
- Create environment files:
- Start the development environment:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Backend Docs: http://localhost:8000/docs
- PostgreSQL: localhost:5432
- Redis: localhost:6379
Development Features
- Hot-reloading for frontend changes
- Auto-reload for backend changes
- Volume mounts for live code updates
- Development-mode Firebase credentials
- Automatic database migrations
- Health checks for all services
Production Deployment
For production deployment, we usedocker-compose.prod.yml which provides:
- Optimized multi-stage builds
- Nginx for frontend serving
- Gunicorn for backend serving
- Production-grade configurations
- Health monitoring
- Automatic restarts
Production Setup
- Set up environment files:
- Configure Firebase (Optional):
- Start production services:
Production Features
- Multi-stage builds for smaller images
- Nginx configuration for frontend
- Gunicorn with multiple workers
- Redis persistence
- Database backups
- Automatic health checks
- Container restart policies
Docker Images
Frontend Images
-
Development:
Dockerfile.frontend- Node.js development server
- Hot-reloading enabled
- Volume mounts for live updates
-
Production:
Dockerfile.frontend.prod- Multi-stage build
- Nginx for static file serving
- Optimized build size
- Health monitoring
Backend Images
-
Development:
Dockerfile- Python development server
- Auto-reload enabled
- Debug mode
-
Production:
Dockerfile.backend.prod- Multi-stage build
- Gunicorn server
- Optimized dependencies
- Worker configuration
Database Image
- Custom PostgreSQL image with pgvector
- Vector similarity search support
- Automatic initialization
- Health checks
Environment Variables
Frontend Variables
Backend Variables
Production Additional Variables
Health Checks
All services include health checks:- Frontend: Checks HTTP endpoint
- Backend: Monitors API health
- PostgreSQL: Verifies database connection
- Redis: Ensures cache availability
Volumes
Persistent data is managed through Docker volumes:postgres_data: Database filesredis_data: Cache databackend_data: Uploaded filesfrontend_node_modules: NPM packages
Networks
Services communicate through Docker networks:- Development:
app-network - Production:
chattermate-network
Monitoring
Monitor your deployment using Docker commands:Help Center custom domains (self-hosted)
The Help Center can be served on your customers’ own domains with automatic HTTPS. Thechattermate-deploy CLI bundles a Caddy edge
proxy that terminates TLS and issues certificates automatically — no manual
certbot or nginx.
1
Deploy with a domain
Run
chattermate-deploy init and answer yes to the domain prompt. Enter your
app domain (e.g. app.example.com) and, optionally, a Help Center base domain
(e.g. help.example.com) for org subdomains. Then chattermate-deploy start.2
Point DNS at your server
Add an A/AAAA record for your app domain to the server’s IP. For Help Center
org subdomains, add a wildcard
*.help.example.com A/AAAA record too. Certificates
are issued automatically on the first HTTPS request.3
Add a customer's custom domain
In Customization → Custom domain, add the domain and create the TXT record
shown. Add a CNAME from the customer’s domain to your app domain (which
already resolves to your server), then click Verify.
TLS options
When you giveinit a domain, it asks how HTTPS should be handled:
- Automatic (default) — Caddy obtains and renews free Let’s Encrypt certificates, and issues Help Center custom-domain certs on demand.
- Bring your own certificate — provide a cert + key (PEM); they’re copied
into
./certsand served by Caddy, with no calls to Let’s Encrypt. For Help Center domains, add a block per domain (or a wildcard) — the generatedCaddyfileincludes a commented example. - Terminated upstream — your own reverse proxy / load balancer handles TLS
and forwards plain HTTP to the stack. It must preserve the
Hostheader so the backend can dispatch Help Center domains.
Renewal is automatic — Caddy renews certificates well before expiry with no
cron or certbot. Certificates and the ACME account are stored in the
caddy_data Docker volume, so keep it across restarts and upgrades — deleting
it forces re-issuance and can hit Let’s Encrypt rate limits. If a custom domain
sits behind Cloudflare, set the record to DNS only (grey cloud) for
verification, or the CNAME check fails.Troubleshooting
Common issues and solutions:- Frontend not starting:
- Backend migrations failing:
- Database connection issues:
- Redis connection issues:
- Backend build fails with
No space left on deviceor pipReadTimeoutError:
No space left on device.
- Give the host at least ~15 GB free disk when building from source.
- This only affects building the image yourself — the prebuilt Docker Hub
images (
chattermate/backend,chattermate/frontend) avoid it entirely. - Slow-link download timeouts are already handled in the Dockerfiles
(
PIP_DEFAULT_TIMEOUT=120andpip --retries 10).
- Help Center custom domain stuck on “SSL Provisioning” / returns 404:
- Deploy with the
chattermate-deployCLI and a domain (see Help Center custom domains) — a plain localhost deploy has no TLS edge and can’t serve custom domains. - Check the domain resolves to your server (
CNAMEto your app domain) and that ports 80 and 443 are open — Let’s Encrypt validates over both. - The certificate is issued on the first HTTPS request; give it a few seconds,
then re-check
Verify. Inspect the edge withdocker compose logs caddy.