Trim comments to the non-obvious why
Test and deploy / test (push) Successful in 28s
Test and deploy / deploy (push) Successful in 31s

Drop narration, history and restated-code comments across the repo,
keep short ones for security boundaries, upstream quirks and ordering
constraints, and record the convention in CLAUDE.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
2026-11-24 20:49:03 +00:00
co-authored by Claude Opus 5.5
parent effddd2794
commit 4530cb8dc4
222 changed files with 1173 additions and 5423 deletions
+7 -57
View File
@@ -1,77 +1,32 @@
# =============================================================================
# docker-compose.dev.yml — local development OVERRIDE layer.
#
# WHAT IT DOES
# This file is never used alone. It is merged on top of docker-compose.yml:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up --build
# Compose merges per-key: `environment` entries are added to (not replacing)
# the base ones, while `command` and `ports` are replaced wholesale. Anything
# not mentioned here keeps its production definition.
#
# WHAT CHANGES vs PRODUCTION
# - vue : one-shot `vite build` becomes the long-running Vite dev server
# with the source bind-mounted for hot reload.
# - backend : dev flags on, including database seeding.
# - caddy : CADDY_SITE=dev, which loads caddy/sites/dev.caddy instead of
# the production sites: no redirects, no security headers, a
# certificate from Caddy's own local CA, `/` proxied to Vite.
# - python : uvicorn --reload with the app source bind-mounted.
# - cloudflared : disabled entirely.
#
# HOW TO REACH IT
# http://localhost (HTTPS also works on :443 with the local-CA certificate,
# which the browser will warn about — that is expected).
#
# NOT USED ON THE PI. The deploy workflow runs plain `docker compose up`.
# =============================================================================
# Dev overrides, layered on docker-compose.yml. Serves http://localhost (and
# https with Caddy's local CA).
services:
vue:
# Replaces the one-shot `vite build`: the container now stays up serving
# the Vite dev server on :5173, which caddy/sites/dev.caddy proxies `/` to.
command: ["npm", "run", "dev"]
volumes:
- ./vue:/app
# The bare path is an ANONYMOUS-VOLUME MASK, not a typo. Binding
# ./vue over /app would otherwise hide the node_modules that were
# installed *inside* the image. Declaring it as an anonymous volume
# re-exposes the image's copy on top of the bind mount, so the
# `npm ci` result survives and the host does not need node_modules.
# Masks the bind mount so the image's node_modules survive.
- /app/node_modules
environment:
- NODE_ENV=development
backend:
environment:
# Spotify requires an exact redirect URI match, so dev needs its own
# (and this localhost URI must be registered in the Spotify app).
# Spotify needs an exact redirect match, registered in the app.
- SPOTIFY_REDIRECT_URI=https://localhost/api/spotify/callback
# GraphQL playground + introspection: convenient locally, and off in
# production so the schema is not published to the world.
- GQL_PLAYGROUND=true
- GQL_INTROSPECTION=true
- DEV_MODE=true
# SEED_DB=true makes the backend populate the database with test
# posts/users/messages on startup (services/ seeding). Safe here
# because dev uses a throwaway local dbdata volume; it is NEVER set
# in production — seeding a live database would inject fake content.
# Dev only: seeds an admin with a known password.
- SEED_DB=true
caddy:
environment:
# The single switch that loads caddy/sites/dev.caddy instead of
# the production sites: localhost on http and https, `tls
# internal`, `/` -> Vite.
- CADDY_SITE=dev
python:
# Same command as the Dockerfile's CMD plus --reload, paired with the
# source bind mount below so editing python/app/ restarts uvicorn.
# ${PYTHON_PORT} here is interpolated by the compose CLI from ./.env,
# not by the container's shell.
command: ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port ${PYTHON_PORT:-8000} --root-path /py --reload"]
volumes:
- ./python/app:/app/app
# The tracker's image ships no hot reload; for that, run its own repo's
# `npm run dev`. Seeded like the backend, with the GraphQL playground at
# /jobs/api/graphql. Login still goes through the backend's seeded admin.
# No hot reload in this image; use its own repo's `npm run dev` for that.
jobs:
environment:
- DEV_MODE=true
@@ -80,11 +35,6 @@ services:
- GQL_INTROSPECTION=true
- MSGRAPH_REDIRECT_URI=https://localhost/jobs/api/email/callback
cloudflared:
# Profiles are opt-in: a service with a profile is only started when
# that profile is explicitly requested. Nothing ever requests
# "disabled", so this is the idiomatic way to switch a service off in
# an override file. A dev stack must never join the production tunnel:
# Cloudflare would load-balance real visitors onto this machine's
# seeded database.
# Never start: a dev stack on the tunnel would get real visitors.
profiles:
- disabled