# Staging Agentic Ops — isolado da produção VM122
# Portas: API 8180, Frontend 8192, Redis interno
# Dados: /var/lib/ligbox-ops-platform-staging (separado)

version: "3.8"
services:
  redis-staging:
    image: redis:7-alpine
    restart: unless-stopped
    command: redis-server --maxmemory 64mb --maxmemory-policy allkeys-lru
    networks: [agentic-staging]
  api-staging:
    build: ./api
    restart: unless-stopped
    env_file: .env
    environment:
      SQLITE_PATH: /data/ops-staging.db
      REDIS_URL: redis://redis-staging:6379/0
      OPS_API_URL: http://api-staging:8080
      ACCESS_MATRIX_UI: "1"
      ACCESS_MATRIX_EDIT: "1"
    volumes:
      - /var/lib/ligbox-ops-platform-staging:/data
      - ./specs:/opt/ligbox-ops-platform/specs:ro
    ports:
      - "10.10.10.122:8180:8080"
    depends_on: [redis-staging]
    networks: [agentic-staging]
  worker-staging:
    build: ./worker
    restart: unless-stopped
    env_file: .env
    environment:
      OPS_API_URL: http://api-staging:8080
      REDIS_URL: redis://redis-staging:6379/0
      AGENTIC_INTERVAL_SEC: "600"
    depends_on: [redis-staging, api-staging]
    networks: [agentic-staging]
  frontend-staging:
    build:
      context: ./frontend
      dockerfile: Dockerfile.staging
    restart: unless-stopped
    ports:
      - "10.10.10.122:8192:80"
    depends_on: [api-staging]
    networks: [agentic-staging]
networks:
  agentic-staging:
    driver: bridge
