services:

  faceliveness:
    image: awareknomi/face-liveness:5.0.1
    container_name: faceliveness
    restart: unless-stopped
    ports:
      - "8086:8086"
    volumes:
      - ./logs/faceliveness:/aw_knomi_face_liveness/logs
    environment:
      - KNOMI_FACE_LIVENESS_PORT=8086
      - KNOMI_FACE_LIVENESS_URL_PATH=faceliveness
      - KNOMI_FACE_LIVENESS_LOG_CONFIG=/faceliveness_config/face_liveness_log_config.ini
      - KNOMI_FACE_LIVENESS_DEVICE_METRICS_URL=http://device-metrics:9087/devicemetrics
    depends_on:
      device-metrics:
        condition: service_healthy
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:8086/faceliveness/version || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 30s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - knomi-net

  device-metrics:
    image: awareknomi/device-metrics:1.3.1
    container_name: devicemetrics
    restart: unless-stopped
    ports:
      - "9087:9087"
    volumes:
      - ./data:/app/data
    healthcheck:
      test: ["CMD-SHELL", "curl -sf http://localhost:9087/devicemetrics/version || exit 1"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 30s
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "3"
    networks:
      - knomi-net

networks:
  knomi-net:
    name: knomi-net
