refactor(docker): default compose builds from Dockerfiles (baked deps, cached)

Chosen flow: build on the host from backend/scrobble Dockerfiles instead of
pulling from a registry (no registry / no Docker-on-dev needed). Heavy deps are
baked, so restarts are instant and rebuilds after git pull are cache-fast.
Removed the now-obsolete docker-compose.dev.yml (runtime-install variant); the
optional push-to-registry script stays for a future CI flow. Updated README,
CLAUDE.md, .env.example.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
HoneyandClaude Opus 4.8 committed 2026-09-02 13:34:00 +02:00
1 parent 1d8d8143f2
commit 767d088665
5 files changed
+33 -105

No files matched your search

+20 -16
View File
@@ -1,33 +1,36 @@
# Default (production) stack — PULLS pre-built images instead of building on the host.
# NovaSonic — builds locally from the Dockerfiles. The heavy deps (ffmpeg, Deno, yt-dlp, node libs)
# are baked into the images, so container RESTARTS are instant, and a rebuild after a code change is
# fast (Docker caches the dep layers — only the code COPY layer changes).
#
# docker compose pull
# docker compose up -d
# git pull
# docker compose up -d --build # rebuild changed images (cached; fast) and (re)start
# docker compose up -d # just (re)start with the already-built images
#
# Build & push the images from your dev machine with: npm run push-images
# (see scripts/build-push-images.mjs). Set REGISTRY + TAG in .env (see .env.example).
# To build on the host instead (dev), use docker-compose.dev.yml.
# No registry needed. (An optional pull-from-registry / CI flow can build these same Dockerfiles
# elsewhere and push — see scripts/build-push-images.mjs + .env.example.)
services:
# ── Frontend (nginx serving the built PWA) ───────────────────────────────────
novasonic-frontend:
image: ${REGISTRY}/novasonic-frontend:${TAG:-latest}
pull_policy: always
build: .
container_name: novasonic-frontend
restart: unless-stopped
ports:
- "8080:80"
- "8080:80" # route this port through your reverse proxy
environment:
- NAVIDROME_URL=${NAVIDROME_URL}
- NAVIDROME_URL=${NAVIDROME_URL} # pre-filled on the setup screen
- BACKEND_URL=${BACKEND_URL}
- SCROBBLE_URL=${SCROBBLE_URL}
# ── Backend (yt-dlp download server) ─────────────────────────────────────────
novasonic-backend:
image: ${REGISTRY}/novasonic-backend:${TAG:-latest}
pull_policy: always
build:
context: ./backend
container_name: novasonic-backend
restart: unless-stopped
volumes:
- ${MUSIC_PATH}:${MUSIC_PATH} # exact path from .env, no remapping
- novasonic-data:/data
- novasonic-data:/data # writable data dir for overrides, state, etc.
ports:
- "3700:3700"
environment:
@@ -45,13 +48,14 @@ services:
- GITEA_TOKEN=${GITEA_TOKEN:-}
- GITEA_APK_TAG=${GITEA_APK_TAG:-apk-latest}
# ── Scrobble service (isolated timestamped play-log → stats + Wrapped) ────────
novasonic-scrobble:
image: ${REGISTRY}/novasonic-scrobble:${TAG:-latest}
pull_policy: always
build:
context: ./scrobble
container_name: novasonic-scrobble
restart: unless-stopped
volumes:
- novasonic-scrobble-data:/data
- novasonic-scrobble-data:/data # own DB volume, isolated from downloads
ports:
- "3710:3710"
environment: