version: "3.8"
services:
  redis:
    image: redis:7-alpine
    restart: unless-stopped
    command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
    networks: [ops]
  api:
    build: ./api
    restart: unless-stopped
    env_file: .env
    volumes:
      - /var/lib/ligbox-ops-platform:/data
    ports:
      - "10.10.10.122:8080:8080"
    depends_on: [redis]
    networks: [ops]
  worker:
    build: ./worker
    restart: unless-stopped
    env_file: .env
    environment:
      OPS_API_URL: http://api:8080
      AUDIT_INTERVAL_SEC: "600"
      LEAD_SYNC_INTERVAL_SEC: "900"
      ONBOARD_STALE_HOURS: "24"
      OPS_INTERNAL_TOKEN: ${OPS_INTERNAL_TOKEN}
    depends_on: [redis, api]
    networks: [ops]
  frontend:
    build: ./frontend
    restart: unless-stopped
    ports:
      - "10.10.10.122:8091:80"
    depends_on: [api]
    networks: [ops]
networks:
  ops:
    driver: bridge
