Skip to content

Docker Installation

Production-ready Docker deployment for Ops Atlas.

Quick Setup

bash
# Create directory
mkdir -p ~/ops-atlas && cd ~/ops-atlas

# Download compose file
curl -O https://raw.githubusercontent.com/ops-atlas/ops-atlas/main/docker-compose.yml

# Create environment file
cat > .env << 'ENVFILE'
# Database
POSTGRES_PASSWORD=your-secure-password-here
DATABASE_URL=postgres://postgres:your-secure-password-here@db:5432/opsatlas

# Security
JWT_SECRET=generate-a-64-char-secret-here
ENCRYPTION_KEY=generate-another-64-char-secret

# App
APP_URL=https://ops.yourdomain.com
ENVFILE

# Start services
docker-compose up -d

docker-compose.yml

yaml
version: '3.8'

services:
  ops-atlas:
    image: opsatlas/ops-atlas:latest
    container_name: ops-atlas
    restart: unless-stopped
    ports:
      - "3000:3000"
    environment:
      - DATABASE_URL=${DATABASE_URL}
      - REDIS_URL=redis://redis:6379
      - JWT_SECRET=${JWT_SECRET}
    depends_on:
      - db
      - redis
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  db:
    image: postgres:15-alpine
    container_name: ops-atlas-db
    restart: unless-stopped
    environment:
      - POSTGRES_DB=opsatlas
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    volumes:
      - postgres_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    container_name: ops-atlas-redis
    restart: unless-stopped
    volumes:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

volumes:
  postgres_data:
  redis_data:

Reverse Proxy Setup

Nginx

nginx
server {
    listen 80;
    server_name ops.yourdomain.com;
    return 301 https://$server_name$request_uri;
}

server {
    listen 443 ssl http2;
    server_name ops.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/ops.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/ops.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Caddy

ops.yourdomain.com {
    reverse_proxy localhost:3000
}

SSL with Let's Encrypt

bash
# Install certbot
sudo apt install certbot python3-certbot-nginx

# Get certificate
sudo certbot --nginx -d ops.yourdomain.com

# Auto-renewal is configured automatically

Updates

bash
# Pull latest images
docker-compose pull

# Restart with new version
docker-compose up -d

# Check logs
docker-compose logs -f ops-atlas

Backup

bash
# Backup database
docker exec ops-atlas-db pg_dump -U postgres opsatlas > backup.sql

# Backup volumes
docker run --rm -v ops-atlas_postgres_data:/data -v $(pwd):/backup alpine tar czf /backup/postgres-backup.tar.gz -C /data .

Released under the MIT License.