Guides
Deploy with Docker Compose
Single-host production deployment with the bundled docker-compose.prod.yml and install.sh.
Got one beefy server and want AskAIs Customer Service running in 10 minutes? This is the path. Good for under ~500 concurrent visitors; for larger scale jump to the Kubernetes guide.
Prerequisites
- A Linux host with Docker 24+ and `docker compose` v2
- ≥ 2 vCPU, 4 GB RAM (8 GB recommended)
- A domain pointed at the host (for TLS via Caddy / Cloudflare / nginx)
One-line install
git clone https://github.com/singlink/singlink
cd singlink
APP_DOMAIN=chat.acme.com bash scripts/install.shThe script:
- Checks for docker + openssl
- Generates
.env.prodwith strong random secrets (mode 600) - Builds the three images (web / ws / worker)
- Brings the full stack up with
docker compose -f docker-compose.prod.yml up -d - Runs
prisma migrate deployinside the web container
What runs
- postgres — pgvector PG16
- redis — pub/sub + queue (password-protected)
- minio — S3-compatible storage for attachments
- web / ws / worker — the three app processes
- nginx — reverse proxy on port 8080 with WS upgrade
Adding TLS
The bundled nginx terminates HTTP/1.1 on port 8080. Put a TLS-terminating proxy in front:
Caddy (easiest)
# /etc/caddy/Caddyfile
chat.acme.com {
reverse_proxy localhost:8080
}Cloudflare Tunnel (no inbound port at all)
cloudflared tunnel create singlink
cloudflared tunnel route dns singlink chat.acme.com
cloudflared tunnel run --url http://localhost:8080 singlinkDay-2 operations
# Logs
docker compose -f docker-compose.prod.yml logs -f
# Restart everything
docker compose -f docker-compose.prod.yml restart
# Stop (data persists in named volumes)
docker compose -f docker-compose.prod.yml down
# Upgrade
git pull
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d --build
docker compose -f docker-compose.prod.yml exec web pnpm db:deploy
# Backups (run from cron daily)
docker compose -f docker-compose.prod.yml exec -T postgres \
pg_dump -U singlink singlink | gzip > /backups/singlink-$(date +%F).sql.gzScaling out workers
Run more AI worker replicas (Redis BullMQ handles distribution):
docker compose -f docker-compose.prod.yml up -d --scale worker=4When to graduate to Kubernetes
- You need HA postgres / redis (managed RDS / ElastiCache)
- You need autoscaling under traffic spikes
- You're running it across multiple regions
- Single-host downtime is unacceptable for your SLA
Then jump to Kubernetes / Helm.