Files
stackpilot/docker-compose.yml
menzeljandClaude Opus 4.8 5b59f5e8f9 Perf: serve stacks list from one Docker call; registry host → 10.10.6.10 (0.21.6)
Stacks overview and detail were doing an N+1 inspect storm: list_stacks
called containers_for_stack AND compute_status (which re-fetched) per
stack, and containers.list(sparse=False) full-inspects every container
plus c.image triggered an image-inspect each. For N stacks that was
~2N*(1 list + M inspects + M image-inspects) sequential socket round
trips (~1s for just 2 stacks, growing linearly).

- compose_service.stack_status_summaries(): one low-level
  api.containers(all=True) summary call grouped by compose project label
  → whole list served in a single Docker round-trip (~10x faster).
- compute_status() takes optional pre-fetched containers; get_stack and
  _stack_summary no longer double-fetch.
- containers_for_stack() reads the image name from the inspect it already
  has instead of c.image (drops the per-container image-inspect).
- Same batching applied to the agent's stack list/detail.

Also: Forgejo (registry + git) moved to 10.10.6.10:3020 — updated image
refs in docker-compose.yml, agent/Dockerfile, agent/docker-compose.yml.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 18:53:12 +00:00

48 lines
1.9 KiB
YAML

services:
backend:
image: 10.10.6.10:3020/menzelj/stackpilot-backend:latest
build: ./backend
restart: unless-stopped
environment:
- SECRET_KEY=${SECRET_KEY}
- STACKS_DIR=/opt/stacks
- DATA_DIR=/data
- HOST_PROC_PATH=/host_proc
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:5009}
# Optional: comma-separated generic JSON webhook URLs (every event).
# Per-destination webhooks (ntfy/Discord/Slack/Gotify) are managed in the UI.
- NOTIFY_WEBHOOKS=${NOTIFY_WEBHOOKS:-}
# Throwaway image used to snapshot named-volume contents during backups.
- BACKUP_HELPER_IMAGE=${BACKUP_HELPER_IMAGE:-alpine:latest}
# File browser (sidebar) + volume host-path picker. ALLOWED_BROWSE_ROOTS
# limits which paths are reachable; HOST_ROOT_PREFIX is where the host
# filesystem is mounted inside this container (see the volume below).
- ALLOWED_BROWSE_ROOTS=${ALLOWED_BROWSE_ROOTS:-/,/mnt,/media,/srv,/opt}
- HOST_ROOT_PREFIX=${HOST_ROOT_PREFIX:-}
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- ./data:/data
- ${STACKS_HOST_DIR:-./data/stacks}:/opt/stacks
- /proc:/host_proc:ro
# Host devices for GPU/device detection + passthrough (USB/TTY/DRI).
# Read-only; remove if you don't need GPU/device features.
- /dev:/dev:ro
# File browser: to browse/manage the real host filesystem, mount it here
# and set HOST_ROOT_PREFIX=/host_root in .env. Use :ro for read-only
# browsing, or drop :ro to allow edits/uploads/deletes from the UI.
# - /:/host_root
expose:
- "5008"
# Uncomment to expose the API directly (normally proxied by the frontend):
# ports:
# - "5008:5008"
frontend:
image: 10.10.6.10:3020/menzelj/stackpilot-frontend:latest
build: ./frontend
restart: unless-stopped
depends_on:
- backend
ports:
- "5009:80"