From 6c5b2b7754ebcb031aed29c28a43f0918a6a0116 Mon Sep 17 00:00:00 2001 From: bchanot Date: Fri, 9 Oct 2026 16:26:06 +0200 Subject: [PATCH] chore(docker): faunosteo_ naming convention for Docker resources (compose project + container), documented CLI limit --- .claude/memory/decisions.md | 8 ++++++++ .claude/tasks/TODO.md | 9 +++++++++ CLAUDE.md | 6 ++++++ DEPLOY.md | 24 ++++++++++++++++++++++++ docker-compose.yml | 6 +++++- docs/development/SUPABASE.md | 6 ++++++ 6 files changed, 58 insertions(+), 1 deletion(-) diff --git a/.claude/memory/decisions.md b/.claude/memory/decisions.md index e3582897..04fcd024 100644 --- a/.claude/memory/decisions.md +++ b/.claude/memory/decisions.md @@ -296,3 +296,11 @@ Status: closed (recorded in ANATOMICAL_SHEET_MODEL.md §5). Importer (packages/anatomy, one-off, deterministic) emits supabase/seed/anatomical-sheets/equine/v1: document.json, legacy-id-map.json, assets.json + SVG copies, IMPORT-REPORT.md (FR, for the osteopath), equine_v1.sql (idempotent: official platform-owned sheet `faunosteo-cheval` private + 2 asset rows + draft v1 via `private.insert_sheet_draft(null,…)`). Golden test = committed artifacts equal a fresh run. Ids: annotation = catalog zone key on exact FR+EN match (26/26), views main/head, trigger head-trigger, asset/sheet uuids derived from sha256 (uuid v5-like). No medical correction: ssb-dysfunctions kept + anomaly; only degraded slugs normalised and declared; 12 anomalies to validate, 6 informative. Seed listed in config sql_paths (every env) and applied by the PGlite harness (`seed/**`, never seed.sql). Storage: bucket anatomical-sheet-assets private, `.svg`, SELECT policy via `private.can_read_sheet_asset_object` (published reference of usable sheet, or editor), no API writes, operator upload script with service key from env. Alt rejected: data migration for the sheet (immutable file for a draft meant to be edited); TS seeding via PostgREST (needs service key in a committed path); fuzzy zoneMatch at import (26/26 exact, strict equality + report suffices). Status: closed; publication of v1 = explicit user decision after report review. + +--- + +## BDR-035 | 2026-10-09 | Docker resources prefixed `faunosteo_` (multi-SaaS VPS) + +User rule: every Faunosteo Docker resource (container, network, volume, image, future worker/self-hosted Supabase) named `faunosteo_*` when configurable → cohabitation on one VPS without collision. Applied: compose `name: faunosteo` + `container_name: faunosteo_app` (was `faunosteo-web`, stateless, no volume → rename safe). Supabase CLI hard-codes `supabase__` → suffix `faunosteo`, documented limit, no wrapper. Rule for future persistent volumes: keep volume name across renames. +Alt rejected: wrapping `supabase start` to rename containers (fragile, breaks CLI status/stop). +Status: closed (DEPLOY.md "Docker resource naming", SUPABASE.md §3, CLAUDE.md). diff --git a/.claude/tasks/TODO.md b/.claude/tasks/TODO.md index 6f2e6dc9..2ab5b42d 100644 --- a/.claude/tasks/TODO.md +++ b/.claude/tasks/TODO.md @@ -76,6 +76,15 @@ feat/findings-tree-v2 merged (FindingsTreePicker tracked in HEAD); all work belo - [x] 4b.3 seed: equine_v1.sql idempotent (platform-owned official sheet, private, draft v1, 2 asset rows, fixed ids) in config sql_paths + PGlite harness applies supabase/seed/**; pgTAP 006: draft present, not publishable by non-admin, sheet_document_issues empty, assets match; upload script for the SVG bytes (service key from env, user/operator runs) - [x] 4b.4 real stack: db reset + db test + types check + assets upload + REST read check; docs (SUPABASE.md, ANATOMICAL_SHEET_MODEL.md §6 import, CLAUDE.md, plan note, CHANGELOG) - [x] 4b.5 verify: pnpm check green (61+30+20+278), real stack 256/256, types in sync, docker build OK, Storage API 400→200 after confirmation (alice/anon 400); verifier ECARTS(4) + security MEDIUM (hash claim) → fixed (uploaded_at + confirm RPC, authored labels, seeds-listed test, Dockerfile manifests); EVAL-009 +- [x] Step 4b VALIDATED by user 2026-10-09 → finished into develop. Draft stays private, never auto-published. +- [ ] Step 4c — equine sheet audit, correction, enrichment (2026-10-09, branch feature/step-04c-equine-curation). User brief: research-backed audit of SVG annotations + findings catalog, corrections by confidence level (A demonstrated / B supported, flagged / C uncertain, question for the osteopath), traceable changeset (id, before, after, nature, rationale, references, level, needs confirmation), reproducible baseline of the 4b import, no publication, no design redesign (propose first). + - [ ] 4c.0 Docker naming convention `faunosteo_` (compose container/project names; Supabase CLI names fixed `supabase__` → documented limit). Docs + memory (BDR). + - [ ] 4c.1 domain schema v2: document `references` registry + node `reference_ids`, `review_status` on nodes and annotations, `count_range` on vertebral regions; rules `finding.reference.missing`, `region.count_range.invalid`; tests; migration extending the schema CHECK + SQL issues; types regen; pgTAP. + - [ ] 4c.2 packages/anatomy curation layer: changeset schema (Zod, JSON data), applier (set / rename / add / remove / move / cite / annotation ops), before-values captured by the applier, CHANGELOG + REVIEW-REPORT generators, diff v1 → draft; seed dir restructure: `legacy-import/` (baseline, generated) + `draft/` (curated working revision, seeded); cleaned SVG asset (legacy markers stripped), head view = view_box crop of the single asset. + - [ ] 4c.3 research (parallel agents, WebSearch): axial skeleton + vertebral variation; skull/sutures/SBS/TMJ/hyoid; appendicular nomenclature NAV/Barone; osteopathic terminology + French legal scope + vet red flags; catalog analyzer pass. Output: findings with verifiable references, classified A/B/C. + - [ ] 4c.4 content changes: sphenoid zone restructured (SSB tree duplicated under sphenoid), terminology (lésion → dysfonction, NAV names, FR grammar), 62 EN descriptions + EN disclaimer, vet flags audit, references registry + citations, additions (carpus…), SVG point moves (B, before/after renders), Cd range 15–21. + - [ ] 4c.5 reports: REVIEW-REPORT.md for the osteopath (10 sections, questions ranked), CHANGELOG table, before/after PNGs, quantitative before/after. + - [ ] 4c.6 verify: pnpm check, PGlite + real stack pgTAP, types, docker build, golden tests; gates verifier + security; docs (spec §6/§7, SUPABASE.md, CLAUDE.md, plan Step 4c, CHANGELOG); memory (BDR/LRN/EVAL/journal). Stop for user validation. --- diff --git a/CLAUDE.md b/CLAUDE.md index 5f4c2245..041febfd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -96,6 +96,12 @@ docker compose up --build docker compose down ``` +Naming convention: every Docker resource Faunosteo owns is prefixed `faunosteo_` +when the name is configurable (container `faunosteo_app`, Compose project +`faunosteo`); the Supabase CLI imposes `supabase__faunosteo`, documented +as a limit in DEPLOY.md "Docker resource naming". Never rename a resource that +holds data without keeping its volume. + Note: no global pnpm needed. `corepack enable` once (reads `packageManager`), or call `corepack pnpm `. Root scripts resolve `node_modules/.bin/pnpm`. diff --git a/DEPLOY.md b/DEPLOY.md index f6e9ba0d..91289ca2 100644 --- a/DEPLOY.md +++ b/DEPLOY.md @@ -21,6 +21,30 @@ The host should publish only ports `22`, `80`, `443` to the internet. The container port (`8080` by default) should stay loopback-only — the host reverse proxy reads from it on `127.0.0.1:8080`. +### Docker resource naming + +Several SaaS may share one VPS, so every Docker resource Faunosteo owns +carries the `faunosteo_` prefix whenever its name is configurable: +containers, Compose project (hence networks and named volumes), images and +future services (`faunosteo_app`, `faunosteo_worker`, `faunosteo_supabase_db`…). + +| Resource | Name | Set by | +| ------------------------------ | ------------------------------------- | ---------------------------------------- | +| SPA container | `faunosteo_app` | `container_name` in `docker-compose.yml` | +| Compose project, network | `faunosteo`, `faunosteo_default` | top-level `name:` in `docker-compose.yml` | +| Local Supabase stack (CLI) | `supabase__faunosteo` | `project_id` in `supabase/config.toml` | + +Known limit: the Supabase CLI hard-codes `supabase__` +for its containers, volumes and network (`supabase_network_faunosteo`); the +project id is a suffix, not a prefix. The name stays unique per SaaS, so no +workaround is applied. A self-hosted production Supabase (docs/development/ +SUPABASE.md §10) is a Compose project we write ourselves and must follow the +prefix (`faunosteo_supabase_db`, `faunosteo_supabase_auth`, …). + +Renaming a container never touches data: the SPA container holds no volume. +When a future service gains a named volume, keep the volume name across a +rename (`external: true` or an explicit `name:`) instead of recreating it. + --- ## Required environment diff --git a/docker-compose.yml b/docker-compose.yml index 267df6fa..7bf2fde5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,10 @@ +# Every Faunosteo-owned Docker resource is named `faunosteo_*` (DEPLOY.md +# "Docker resource naming"): project name = network / default volume prefix. +name: faunosteo + services: app: - container_name: faunosteo-web + container_name: faunosteo_app build: context: . dockerfile: Dockerfile diff --git a/docs/development/SUPABASE.md b/docs/development/SUPABASE.md index 2f0e4325..d77c2929 100644 --- a/docs/development/SUPABASE.md +++ b/docs/development/SUPABASE.md @@ -66,6 +66,12 @@ Local endpoints (`config.toml`): `pnpm db:start` prints the `anon` and `service_role` keys. Only the anon key ever reaches the browser. +Containers, volumes and network are named `supabase__faunosteo` +(`project_id` of `config.toml`): the CLI imposes this pattern, so the +`faunosteo_` prefix convention of DEPLOY.md ("Docker resource naming") +applies as a suffix here. Several projects can run side by side as long as +their `project_id` and ports differ. + Two kinds of seed (`config.toml [db.seed] sql_paths`): | File | Scope | Content |