feedBack/docker-compose.yml
Byron Gamatos ebe59d3f97
Some checks are pending
ship-ci / ci (push) Waiting to run
refactor(server): extract the audio-effects routes into routers/audio_effects.py (R3) (#834)
The first route module through the appstate seam (#833). Picked BY MEASUREMENT,
not by the plan's guess: a transitive dep-closure scan over every route group
ranked audio-effects at 0 monkeypatch.setattr targets and exactly one exclusive
helper. (The same scan disproved the plan's assumption that artists/aliases was
free -- api_artist_links reaches _mb_http_get and _enrich_network_enabled, both
setattr targets.)

Bodies are verbatim. The only edits are mechanical:
  @app.get(...)            -> @router.get(...)
  audio_effect_mappings.x  -> appstate.audio_effect_mappings.x

The singleton read must stay a module attribute resolved at call time, so a
re-imported server re-publishes a fresh DB into the seam and monkeypatch reaches
this module. `routers/` never imports `server`: server -> routers -> appstate.

`app.include_router(...)` sits exactly where the routes used to be defined --
FastAPI matches in registration order, so the mount site preserves it. Verified
by diffing the FULL route table against origin/main: 143 routes, identical
paths, methods AND order.

server.py: 9,445 -> 9,386 lines. `fastapi.Query` went dead with the move and was
removed (the other four unused imports are pre-existing on main).

Packaging: COPY routers/ /app/routers/ plus `!routers/` + `!routers/**` in
.dockerignore (that file opens with a blanket `*`). Verified against the real
docker daemon: routers/ reaches the build context, __pycache__ does not.

Verified: pyflakes clean on routers/; no new undefined name in server.py;
pytest 2348 passed (75 in the audio-effects + demo-mode suites); eslint 0
errors; boot smoke drives all five routes end-to-end (create -> read back ->
activate -> clear -> delete -> 404 on missing -> 400 on bad body), Query(...)
still 422s on a missing required param, and demo mode still 403s all four
moved write routes while allowing the read.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-10 15:24:31 +02:00

40 lines
1.3 KiB
YAML

services:
web:
build: .
ports:
- "8000:8000"
volumes:
# Mount your song library folder (adjust path for your system)
- ${LIBRARY_PATH:-./library}:/dlc
# Persistent config and cache
- feedBack-config:/config
# Mount source for live reload during development
- ./static:/app/static
- ./server.py:/app/server.py
- ./appstate.py:/app/appstate.py
- ./routers:/app/routers
- ./VERSION:/app/VERSION
- ./ug_browser.py:/app/ug_browser.py
- ./lib:/app/lib
- ./plugins:/app/plugins
- ./.git:/app/.git:ro
environment:
- PYTHONPATH=/app/lib:/app
- DLC_DIR=/dlc
- CONFIG_DIR=/config
# Write note_detect recordings to the host-visible bind mount (./static)
# rather than the /config Docker volume: recorded takes (and training
# bundles) then land in static/note_detect_recordings/ on the host, where
# the offline harness can read them directly.
- STATIC_DIR=/app/static
# Logging (optional)
# - LOG_LEVEL=DEBUG # DEBUG | INFO | WARNING | ERROR (default: INFO)
# - LOG_FORMAT=json # json | text (default: text — coloured console)
# - LOG_FILE=/config/feedBack.log # also write to a persistent file
dns:
- 8.8.8.8
- 1.1.1.1
volumes:
feedBack-config: