legalis-api 0.1.4

REST/GraphQL API server for Legalis-RS
Documentation
version: '3.8'

services:
  # Legalis API Server
  api:
    build:
      context: ../..
      dockerfile: crates/legalis-api/Dockerfile
    ports:
      - "3000:3000"
    environment:
      - RUST_LOG=info
      - LEGALIS_HOST=0.0.0.0
      - LEGALIS_PORT=3000
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 5s
    restart: unless-stopped
    networks:
      - legalis-network

  # Optional: Redis for caching (future enhancement)
  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 3s
      retries: 3
    restart: unless-stopped
    networks:
      - legalis-network
    volumes:
      - redis-data:/data

  # Optional: Prometheus for metrics collection
  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
      - prometheus-data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    restart: unless-stopped
    networks:
      - legalis-network

  # Optional: Grafana for metrics visualization
  grafana:
    image: grafana/grafana:latest
    ports:
      - "3001:3000"
    environment:
      - GF_SECURITY_ADMIN_PASSWORD=admin
      - GF_USERS_ALLOW_SIGN_UP=false
    volumes:
      - grafana-data:/var/lib/grafana
    restart: unless-stopped
    networks:
      - legalis-network
    depends_on:
      - prometheus

networks:
  legalis-network:
    driver: bridge

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