Skip to main content

Overview

The easiest way to deploy Wryft Chat is using Docker Compose.

Prerequisites

  • Docker 20.10+
  • Docker Compose 2.0+
  • 2GB RAM minimum
  • 10GB storage

Quick Deploy

1

Clone repository

git clone https://github.com/Warehouser-dev/wryft-chat.git
cd wryft-chat
2

Configure environment

cp backend/.env.example backend/.env
cp wryft-web/.env.example wryft-web/.env
Edit the .env files with your configuration.
3

Start services

docker-compose up -d
4

Run migrations

docker-compose exec backend psql -d wryft -f /app/migrations/*.sql

Docker Compose Services

The docker-compose.yml includes:

Backend

  • Rust API server
  • Port: 3001
  • Auto-restarts on failure

Frontend

  • Nginx serving React app
  • Port: 80
  • Gzip compression enabled

PostgreSQL

  • Database server
  • Port: 5432
  • Persistent volume

MinIO

  • S3-compatible storage
  • Port: 9000 (API), 9001 (Console)
  • Persistent volume

Redis

  • Cache server
  • Port: 6379
  • Optional (for performance)

Configuration

Backend Environment

DATABASE_URL=postgresql://postgres:password@postgres:5432/wryft
REDIS_URL=redis://redis:6379
S3_ENDPOINT=http://minio:9000
S3_ACCESS_KEY=minioadmin
S3_SECRET_KEY=minioadmin
S3_BUCKET=wryft
PORT=3001

Frontend Environment

VITE_API_URL=http://your-domain.com/api
VITE_WS_URL=ws://your-domain.com

Nginx Configuration

The included nginx.conf provides:
  • Reverse proxy to backend
  • WebSocket support
  • Gzip compression
  • Static file serving
  • CORS headers

Volumes

Persistent data is stored in:
  • postgres_data - Database
  • minio_data - File uploads
  • redis_data - Cache

Scaling

Horizontal Scaling

Scale backend instances:
docker-compose up -d --scale backend=3
Add load balancer (nginx/traefik) in front.

Vertical Scaling

Increase resources in docker-compose.yml:
services:
  backend:
    deploy:
      resources:
        limits:
          cpus: '2'
          memory: 2G

Monitoring

View Logs

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f backend

Health Checks

# Backend health
curl http://localhost:3001/api/health

# Database
docker-compose exec postgres pg_isready

Backup

Database Backup

docker-compose exec postgres pg_dump -U postgres wryft > backup.sql

Restore Database

docker-compose exec -T postgres psql -U postgres wryft < backup.sql

MinIO Backup

docker-compose exec minio mc mirror /data/wryft /backup/wryft

Updating

# Pull latest code
git pull

# Rebuild containers
docker-compose build

# Restart services
docker-compose up -d

Troubleshooting

Check logs: docker-compose logs backend
Verify PostgreSQL is running: docker-compose ps postgres
Increase Docker memory limit in Docker Desktop settings

Next Steps