services: # Parca Server - stores and visualizes profiles parca-server: image: ghcr.io/parca-dev/parca:v0.22.0 command: - /parca - --config-path=/etc/parca/parca.yaml - --log-level=info - --storage-active-memory=2147483648 # 2GB RAM storage - --http-address=:7070 - --storage-path=/var/lib/parca volumes: - ./parca-server.yaml:/etc/parca/parca.yaml:ro - parca-data:/var/lib/parca ports: - "7070:7070" # UI and API networks: - parca-net healthcheck: test: ["CMD", "wget", "-q", "--spider", "http://localhost:7070/metrics"] interval: 10s timeout: 5s retries: 5 # Parca Agent - eBPF profiler (privileged) # NOTE: Requires Linux host with eBPF support (privileged mode + host pid) parca-agent: image: ghcr.io/parca-dev/parca-agent:v0.35.0 privileged: true # Required for eBPF command: - /bin/parca-agent - --server-address=parca-server:7070 - --node=compose-node - --log-level=info - --metadata-external-labels=environment=demo,service=fastapi - --kubernetes=false - --collect-agent=false volumes: - /:/host:ro,rslave - /sys/kernel/debug:/sys/kernel/debug - /sys/fs/cgroup:/sys/fs/cgroup - /sys/fs/bpf:/sys/fs/bpf - /run:/run - /boot:/boot:ro - /var/run/docker.sock:/var/run/docker.sock:ro pid: host networks: - parca-net depends_on: parca-server: condition: service_healthy # FastAPI Application - target for profiling fastapi-app: build: . command: > uvicorn main:app --host 0.0.0.0 --port 8000 --workers 4 --log-level info ports: - "8000:8000" # Exposed to host for load generator access environment: - PYTHONUNBUFFERED=1 - WORKERS=4 networks: - parca-net healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 5s timeout: 3s retries: 3 deploy: resources: limits: cpus: '2' memory: 1G networks: parca-net: driver: bridge volumes: parca-data: