openserve 2.0.2

A modern, high-performance, AI-enhanced file server built in Rust
Documentation
version: '3.8'

services:
  openserve:
    build: .
    container_name: openserve
    restart: unless-stopped
    ports:
      - "8080:8080"
    volumes:
      - ./files:/app/files
      - ./data:/app/data
      - ./logs:/app/logs
      - ./index:/app/index
      - ./config.yml:/app/config.yml:ro
    environment:
      - RUST_LOG=info
      - OPENSERVE_HOST=0.0.0.0
      - OPENSERVE_PORT=8080
      - OPENSERVE_SERVE_PATH=/app/files
      - DATABASE_URL=sqlite:///app/data/openserve.db
      - REDIS_URL=redis://redis:6379
      - OPENAI_API_KEY=${OPENAI_API_KEY:-}
    depends_on:
      - redis
    networks:
      - openserve-network
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

  redis:
    image: redis:7-alpine
    container_name: openserve-redis
    restart: unless-stopped
    ports:
      - "6379:6379"
    volumes:
      - redis-data:/data
    command: redis-server --appendonly yes
    networks:
      - openserve-network
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 30s
      timeout: 10s
      retries: 3

  prometheus:
    image: prom/prometheus:latest
    container_name: openserve-prometheus
    restart: unless-stopped
    ports:
      - "9090:9090"
    volumes:
      - ./docker/prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/etc/prometheus/console_libraries'
      - '--web.console.templates=/etc/prometheus/consoles'
      - '--storage.tsdb.retention.time=200h'
      - '--web.enable-lifecycle'
    networks:
      - openserve-network

  grafana:
    image: grafana/grafana:latest
    container_name: openserve-grafana
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - grafana-data:/var/lib/grafana
      - ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_USERS_ALLOW_SIGN_UP=false
    networks:
      - openserve-network
    depends_on:
      - prometheus

  nginx:
    image: nginx:alpine
    container_name: openserve-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
      - ./docker/ssl:/etc/nginx/ssl:ro
    depends_on:
      - openserve
    networks:
      - openserve-network

volumes:
  redis-data:
  prometheus-data:
  grafana-data:

networks:
  openserve-network:
    driver: bridge