services:
  policyshield:
    build: .
    volumes:
      - ./policies:/app/policies:ro
      - ./traces:/app/traces
    command: ["validate", "policies/"]

  lint:
    build: .
    volumes:
      - ./policies:/app/policies:ro
    command: ["lint", "policies/rules.yaml"]

  test:
    build: .
    volumes:
      - ./policies:/app/policies:ro
      - ./tests:/app/tests:ro
    command: ["test", "tests/"]

  policyshield-server:
    build:
      context: .
      dockerfile: Dockerfile.server
    ports:
      - "8100:8100"
    volumes:
      - ./policies/:/app/rules/:ro
    environment:
      POLICYSHIELD_MODE: enforce
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8100/api/v1/health"]
      interval: 10s
      timeout: 3s
      retries: 3

