services:
  agent:
    image: wavegrid/agent:0.1.0
    container_name: agent
    environment:
      WGFLOW_CONFIG: /etc/wg-flow-agent/config.yaml
      WGFLOW_PLUGINS_DIR: /var/lib/wg-flow-agent/plugins
      WGFLOW_INSTALLED_PLUGINS: /var/lib/wg-flow-agent/installed_plugins.json
      WGFLOW_UI_ENABLED: "false"
      WGFLOW_UI_HOST: "0.0.0.0"
      WGFLOW_UI_PORT: "8765"
    ports:
      - "8765:8765"
    volumes:
      - ./config.yaml:/etc/wg-flow-agent/config.yaml
      - agent_data:/var/lib/wg-flow-agent
    restart: unless-stopped
    read_only: true
    tmpfs:
      - /tmp
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test:
        [
          "CMD-SHELL",
          "wg-flow-agent plugin list >/dev/null && test -f /tmp/wg-flow-agent.last-sync",
        ]
      interval: 60s
      timeout: 10s
      retries: 3
      start_period: 120s

volumes:
  agent_data:
