services:
  playwright-mcp:
    image: mcr.microsoft.com/playwright/mcp:v0.0.36
    container_name: ${CONTAINER_NAME}
    restart: always
    networks:
      - 1panel-network
    ports:
      - "${PANEL_APP_PORT_HTTP}:8931"
    volumes:
      - ./data:/app/data
      - ./data/config:/app/config
    working_dir: /app
    environment:
      - NODE_ENV=production
      - PORT=8931
      - BROWSER_TYPE=${BROWSER_TYPE:-chromium}
      - HEADLESS_MODE=${HEADLESS_MODE:-true}
      - VIEWPORT_SIZE=${VIEWPORT_SIZE:-1280,720}
      - USER_AGENT=${USER_AGENT}
    command: ["--port", "8931", "--host", "0.0.0.0"]
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8931/mcp"] 
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 60s
    labels:
      createdBy: "Apps"

networks:
  1panel-network:
    external: true