Overview
Deploy the Zeus server using Docker Compose for easy setup and management.Quick Start
Copy
# Clone repository
git clone https://github.com/olympia-hq/zeus.git
cd zeus
# Create environment file
cp .env.example .env
# Edit configuration
nano .env
# Start services
docker-compose up -d
# Run migrations
docker-compose exec server cargo sqlx migrate run
Docker Compose Configuration
Copy
version: '3.8'
services:
postgres:
image: postgres:14-alpine
environment:
POSTGRES_USER: ${DB_USER:-zeus}
POSTGRES_PASSWORD: ${DB_PASSWORD:-changeme}
POSTGRES_DB: ${DB_NAME:-zeus}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER}"]
interval: 5s
timeout: 5s
retries: 5
server:
build:
context: ./server
dockerfile: Dockerfile
environment:
DATABASE_URL: postgres://${DB_USER:-zeus}:${DB_PASSWORD:-changeme}@postgres/${DB_NAME:-zeus}
RUST_LOG: ${RUST_LOG:-info}
PORT: 3000
JWT_SECRET: ${JWT_SECRET}
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
restart: unless-stopped
volumes:
postgres_data:
Environment Variables
Create.env:
Copy
# Database
DB_USER=zeus
DB_PASSWORD=your_secure_password
DB_NAME=zeus
# Server
JWT_SECRET=your-super-secret-key-min-32-characters
RUST_LOG=info
# Optional
PORT=3000
Production Deployment
With SSL (Let’s Encrypt)
Add Nginx reverse proxy:Copy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./ssl:/etc/nginx/ssl
depends_on:
- server
With Traefik
Copy
traefik:
image: traefik:v2.10
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.letsencrypt.acme.tlschallenge=true"
- "[email protected]"
- "--certificatesresolvers.letsencrypt.acme.storage=/letsencrypt/acme.json"
ports:
- "80:80"
- "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./letsencrypt:/letsencrypt
server:
# ... existing config
labels:
- "traefik.enable=true"
- "traefik.http.routers.zeus.rule=Host(`api.yourdomain.com`)"
- "traefik.http.routers.zeus.tls=true"
- "traefik.http.routers.zeus.tls.certresolver=letsencrypt"
Management Commands
Copy
# View logs
docker-compose logs -f server
# Restart services
docker-compose restart
# Update to latest
docker-compose pull
docker-compose up -d
# Backup database
docker-compose exec postgres pg_dump -U zeus zeus > backup.sql
# Restore database
docker-compose exec -T postgres psql -U zeus zeus < backup.sql
# Stop everything
docker-compose down
# Stop and remove volumes (WARNING: deletes data)
docker-compose down -v
Cloud Deployment
AWS ECS
Use AWS Fargate for serverless containers:Copy
# Build and push to ECR
docker build -t zeus-server ./server
docker tag zeus-server:latest <account>.dkr.ecr.<region>.amazonaws.com/zeus:latest
docker push <account>.dkr.ecr.<region>.amazonaws.com/zeus:latest
# Deploy with ECS CLI
ecs-cli compose up
DigitalOcean App Platform
Copy
# .do/app.yaml
name: zeus-server
services:
- name: server
source_dir: /server
github:
repo: olympia-hq/zeus
branch: main
dockerfile_path: Dockerfile
http_port: 3000
instance_count: 1
instance_size_slug: basic-xs
envs:
- key: DATABASE_URL
value: ${db.DATABASE_URL}
- key: JWT_SECRET
value: ${JWT_SECRET}
databases:
- name: db
engine: PG
version: "14"
size: db-s-dev-database
num_nodes: 1
Health Checks
Server includes health endpoint:Copy
curl http://localhost:3000/health
# {"status": "healthy", "version": "1.0.0"}
Troubleshooting
Container won’t start
Copy
# Check logs
docker-compose logs server
# Verify environment
docker-compose config
Database connection failed
Copy
# Check postgres is running
docker-compose ps
# Test connection
docker-compose exec postgres pg_isready
Migration failures
Copy
# Run migrations manually
docker-compose exec server cargo sqlx migrate run

