Running with Docker
Start the full 5-service Savannah Cloud stack locally using Docker Compose.
Services
docker-compose.yml defines 5 services:
| Container | Image | Port | Purpose |
|---|---|---|---|
riftcloud-app-1 | Built from Dockerfile | 8080 | Go API + Worker pool |
riftcloud-dashboard-1 | Built from dashboard/ | 80 | React UI (Nginx) |
riftcloud-postgres-1 | postgres:16-alpine | 5432 | PostgreSQL database |
riftcloud-redis-1 | redis:7-alpine | 6379 | Job queue + sessions |
riftcloud-pdns-1 | PowerDNS Auth 4.9 | 53, 8081 | Custom domain DNS |
First-time Setup
# 1. Clone the repo
git clone https://github.com/Mbuthia71/distributed-task-queue.git
cd distributed-task-queue
# 2. Create .env with minimum required variables
echo "JWT_SECRET=$(openssl rand -hex 32)" > .env
echo "RESEND_API_KEY=re_..." >> .env
echo "AT_API_KEY=atsk_..." >> .env
echo "AT_USERNAME=your_at_username" >> .env
# 3. Build and start all 5 services
docker compose up -d --buildDATABASE_URL, REDIS_URL, and PDNS_API_URL are set automatically by Docker Compose.
Common Commands
# Start all services (no rebuild)
docker compose up -d
# Rebuild after code changes — ONLY rebuild app and dashboard, NOT postgres
docker compose up -d --build app dashboard
# Stop all services (data preserved)
docker compose down
# Wipe all data (fresh start)
docker compose down -v
# Live logs
docker compose logs -f app
# Check service status
docker compose psNever run docker compose up -d --build without specifying services in production — it will rebuild postgres and may cause auth issues. Always use --build app dashboard.
Health Checks
All services should show Up (healthy) within ~30 seconds:
# Full health check — postgres and redis status included
curl http://localhost:8080/health
# → {"status":"ok","postgres":"ok","redis":"ok"}
# Container status
docker compose ps
# Verify Redis
docker compose exec riftcloud-redis-1 redis-cli ping
# → PONGPostgreSQL Authentication
The stack mounts a custom pg_hba.conf (tracked in repo) into the postgres container. It uses trust for Docker's internal 172.x.x.x network — no password needed for inter-container communication:
host all all 172.0.0.0/8 trust
host all all 0.0.0.0/0 scram-sha-256This permanently prevents SCRAM auth failures when the app container is rebuilt. See Postgres Auth Notes for full details.
Dockerfile
Multi-stage build:
- Stage 1 (
builder) — compiles Go binary + builds React dashboard (npm run build) - Stage 2 (
runtime) — copies binaries into a minimal base image
See Environment Variables for the full variable reference.