2025-12-03 11:05:54 +01:00
|
|
|
version: "3.8"
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
agent:
|
|
|
|
|
build:
|
|
|
|
|
context: .
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
container_name: letsbe-agent
|
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
# Required: Orchestrator connection
|
|
|
|
|
- ORCHESTRATOR_URL=${ORCHESTRATOR_URL:-http://host.docker.internal:8000}
|
|
|
|
|
- AGENT_TOKEN=${AGENT_TOKEN:-dev-token}
|
|
|
|
|
|
2025-12-05 20:10:43 +01:00
|
|
|
# Tenant assignment
|
|
|
|
|
# Required in production. Set to the tenant UUID this agent belongs to.
|
|
|
|
|
# Example: TENANT_ID=550e8400-e29b-41d4-a716-446655440000
|
|
|
|
|
- TENANT_ID=${TENANT_ID:-}
|
|
|
|
|
|
2025-12-03 11:05:54 +01:00
|
|
|
# Timing (seconds)
|
|
|
|
|
- HEARTBEAT_INTERVAL=${HEARTBEAT_INTERVAL:-30}
|
|
|
|
|
- POLL_INTERVAL=${POLL_INTERVAL:-5}
|
|
|
|
|
|
|
|
|
|
# Logging
|
|
|
|
|
- LOG_LEVEL=${LOG_LEVEL:-DEBUG}
|
|
|
|
|
- LOG_JSON=${LOG_JSON:-false}
|
|
|
|
|
|
|
|
|
|
# Resilience
|
|
|
|
|
- MAX_CONCURRENT_TASKS=${MAX_CONCURRENT_TASKS:-3}
|
|
|
|
|
- BACKOFF_BASE=${BACKOFF_BASE:-1.0}
|
|
|
|
|
- BACKOFF_MAX=${BACKOFF_MAX:-60.0}
|
|
|
|
|
- CIRCUIT_BREAKER_THRESHOLD=${CIRCUIT_BREAKER_THRESHOLD:-5}
|
|
|
|
|
- CIRCUIT_BREAKER_COOLDOWN=${CIRCUIT_BREAKER_COOLDOWN:-300}
|
|
|
|
|
|
|
|
|
|
# Security
|
2025-12-03 15:20:07 +01:00
|
|
|
- ALLOWED_FILE_ROOT=${ALLOWED_FILE_ROOT:-/opt/letsbe}
|
2025-12-03 11:05:54 +01:00
|
|
|
- MAX_FILE_SIZE=${MAX_FILE_SIZE:-10485760}
|
|
|
|
|
- SHELL_TIMEOUT=${SHELL_TIMEOUT:-60}
|
|
|
|
|
|
2025-12-08 15:55:16 +01:00
|
|
|
# Playwright browser automation
|
|
|
|
|
- PLAYWRIGHT_ARTIFACTS_DIR=${PLAYWRIGHT_ARTIFACTS_DIR:-/opt/letsbe/playwright-artifacts}
|
|
|
|
|
- PLAYWRIGHT_DEFAULT_TIMEOUT_MS=${PLAYWRIGHT_DEFAULT_TIMEOUT_MS:-60000}
|
|
|
|
|
- PLAYWRIGHT_NAVIGATION_TIMEOUT_MS=${PLAYWRIGHT_NAVIGATION_TIMEOUT_MS:-120000}
|
|
|
|
|
|
2025-12-03 11:05:54 +01:00
|
|
|
volumes:
|
|
|
|
|
# Docker socket for docker executor
|
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
|
|
|
|
|
|
|
|
# Hot reload in development
|
|
|
|
|
- ./app:/app/app:ro
|
2025-12-08 15:55:16 +01:00
|
|
|
- ./tests:/app/tests:ro
|
|
|
|
|
- ./pytest.ini:/app/pytest.ini:ro
|
2025-12-03 11:05:54 +01:00
|
|
|
|
2025-12-03 15:20:07 +01:00
|
|
|
# Host directory mounts for real infrastructure access
|
|
|
|
|
- /opt/letsbe/env:/opt/letsbe/env
|
|
|
|
|
- /opt/letsbe/stacks:/opt/letsbe/stacks
|
|
|
|
|
- /opt/letsbe/nginx:/opt/letsbe/nginx
|
2025-12-03 11:05:54 +01:00
|
|
|
|
|
|
|
|
# Pending results persistence
|
|
|
|
|
- agent_home:/home/agent/.letsbe-agent
|
|
|
|
|
|
2025-12-08 15:55:16 +01:00
|
|
|
# Playwright artifacts storage
|
|
|
|
|
- playwright_artifacts:/opt/letsbe/playwright-artifacts
|
|
|
|
|
|
|
|
|
|
# Security options for Chromium sandboxing
|
|
|
|
|
security_opt:
|
|
|
|
|
- seccomp=unconfined
|
|
|
|
|
|
2025-12-03 11:05:54 +01:00
|
|
|
# Run as root for Docker socket access in dev
|
|
|
|
|
# In production, use Docker group membership instead
|
|
|
|
|
user: root
|
|
|
|
|
|
|
|
|
|
restart: unless-stopped
|
|
|
|
|
|
2025-12-08 15:55:16 +01:00
|
|
|
# Resource limits (increased for Playwright browser automation)
|
2025-12-03 11:05:54 +01:00
|
|
|
deploy:
|
|
|
|
|
resources:
|
|
|
|
|
limits:
|
2025-12-08 15:55:16 +01:00
|
|
|
cpus: '1.5'
|
|
|
|
|
memory: 1G
|
2025-12-03 11:05:54 +01:00
|
|
|
reservations:
|
2025-12-08 15:55:16 +01:00
|
|
|
cpus: '0.25'
|
|
|
|
|
memory: 256M
|
2025-12-03 11:05:54 +01:00
|
|
|
|
|
|
|
|
volumes:
|
|
|
|
|
agent_home:
|
|
|
|
|
name: letsbe-agent-home
|
2025-12-08 15:55:16 +01:00
|
|
|
playwright_artifacts:
|
|
|
|
|
name: letsbe-playwright-artifacts
|