docs: compose files, Dockerfile, CI workflow, README and ci-requirements describe the build, briefly
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 1m8s
CI & Build / Python tests (push) Successful in 1m53s
CI & Build / Build & push image (push) Successful in 51s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Plugin hooks (push) Successful in 12s
CI & Build / TypeScript typecheck (push) Successful in 54s
CI & Build / integration (push) Successful in 1m8s
CI & Build / Python tests (push) Successful in 1m53s
CI & Build / Build & push image (push) Successful in 51s
Comment-only pilot for the comment standard (rule 32, milestone 544).
Issue and rule numbers, dates, run ids and incident stories come out;
the constraint each one guarded stays as a present-tense sentence.
History removed from the files, kept here:
- Dockerfile/CI: installing from uv.lock replaced pip/uv-pip installs that
ignored the lock (#2194, the mcp 2.0.0 break on 2026-07-28); --locked
then caught pgvector missing from the lock.
- CI: plugin paths were added after #2198/#2209 reached a live install;
`integration` joined the build's needs after run 8212 published
:latest with integration red (#4958); the `[[ ]]` tag step failed
silently on dash (2a374d9); BUILD_VERSION carried the channel until
2026-08-31 (#3298).
- jq was removed from the hooks in #4107.
- prod compose: the lenient DB healthcheck followed a runc setns crash
loop; pgvector arrived with migration 0067 via a PG16->17 dump/restore.
Corrections to match the code: README names the Settings tab
"MCP Access"; ci-requirements says the Dockerfile builds on node:22
and lint covers scripts/.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+74
-186
@@ -4,27 +4,15 @@
|
|||||||
# Push to main: typecheck + lint + test + build :latest + :<sha>
|
# Push to main: typecheck + lint + test + build :latest + :<sha>
|
||||||
# Tag v* (release): typecheck + lint + test + build :latest + :<version> + :<sha>
|
# Tag v* (release): typecheck + lint + test + build :latest + :<version> + :<sha>
|
||||||
#
|
#
|
||||||
# Both dev and main are gated AND built. dev pushes move :dev; main pushes move
|
# main is the production line, so :latest tracks main's tip. Every push also
|
||||||
# :latest — main IS the production line, so :latest tracks main's tip and there
|
# gets an immutable :<sha>, the rollback point. A release (a v* tag created on
|
||||||
# is no separate :main tag. Every push also gets an immutable :<sha> (the
|
# main in the Forgejo UI) adds the dated :<version>.
|
||||||
# rollback point). A v* release tag additionally publishes the dated :<version>;
|
|
||||||
# since main already moved :latest, the release tag's distinct job is that
|
|
||||||
# :<version> marker (it refreshes :latest too, harmlessly).
|
|
||||||
#
|
#
|
||||||
# Successive pushes to the SAME ref supersede each other (see concurrency
|
# A newer push to the same ref cancels the older run; dev and main never cancel
|
||||||
# below), so rapid pushes don't stack identical work; dev and main runs are
|
# each other. Pull requests don't trigger runs: branch pushes already gate.
|
||||||
# independent refs and never cancel one another.
|
|
||||||
#
|
#
|
||||||
# To cut a release:
|
# Forgejo Actions doesn't reliably honour `on.push.branches` as a filter, so
|
||||||
# Create a release via the Forgejo UI on main with a v* tag name.
|
# every job repeats the ref check in its `if:`.
|
||||||
# The tag push triggers this workflow; build job pushes :latest + :<version>.
|
|
||||||
#
|
|
||||||
# PRs aren't triggered on purpose — this is a solo dev→main flow, so
|
|
||||||
# gating on branch push is already enough.
|
|
||||||
#
|
|
||||||
# NOTE on the `if:` guards below: Forgejo Actions does not consistently
|
|
||||||
# honor `on.push.branches` as a filter, so every job repeats the ref check
|
|
||||||
# explicitly — permitting dev, main, and v* tags, rejecting anything else.
|
|
||||||
#
|
#
|
||||||
# Required secrets (repo → Settings → Secrets → Actions):
|
# Required secrets (repo → Settings → Secrets → Actions):
|
||||||
# REGISTRY_USER — your Forgejo username
|
# REGISTRY_USER — your Forgejo username
|
||||||
@@ -40,31 +28,22 @@ on:
|
|||||||
- "frontend/**"
|
- "frontend/**"
|
||||||
- "tests/**"
|
- "tests/**"
|
||||||
- "pyproject.toml"
|
- "pyproject.toml"
|
||||||
# The lock now determines what gets installed, so a lock-only change has
|
# The lock decides what is installed, so a lock-only change must run CI.
|
||||||
# to trigger a run — otherwise a dependency bump lands untested.
|
|
||||||
- "uv.lock"
|
- "uv.lock"
|
||||||
- "alembic/**"
|
- "alembic/**"
|
||||||
- "alembic.ini"
|
- "alembic.ini"
|
||||||
- "Dockerfile"
|
- "Dockerfile"
|
||||||
# The plugin ships straight from this repo — installs fetch it via
|
# The plugin ships straight from git (via .claude-plugin/marketplace.json),
|
||||||
# .claude-plugin/marketplace.json, NOT from the image. So a push here is
|
# not in the image, so a push here is its release. See the `plugin` job.
|
||||||
# the release, with no build step in between. Omitting these paths meant
|
|
||||||
# plugin changes triggered no workflow at all, which is how #2198's three
|
|
||||||
# broken hooks and then #2209's missing version bump both reached a live
|
|
||||||
# install. See the `plugin` job below.
|
|
||||||
- "plugin/**"
|
- "plugin/**"
|
||||||
- ".claude-plugin/**"
|
- ".claude-plugin/**"
|
||||||
- "scripts/check_plugin.py"
|
- "scripts/check_plugin.py"
|
||||||
- ".forgejo/workflows/ci.yml"
|
- ".forgejo/workflows/ci.yml"
|
||||||
# Manual trigger from the Forgejo Actions UI. Useful when an image has
|
# Manual run from the Forgejo Actions UI, e.g. to rebuild an image.
|
||||||
# been built but the deployment didn't pick it up, or when re-running
|
|
||||||
# against the same source produces different upstream behaviour
|
|
||||||
# (e.g. a transient HF download flake during the voice-bundle step).
|
|
||||||
workflow_dispatch: {}
|
workflow_dispatch: {}
|
||||||
|
|
||||||
# Cancel older runs on the same branch when a newer push lands. Tag runs
|
# A newer push cancels the older run on the same branch. Tag runs are never
|
||||||
# get their own group implicitly (refs/tags/v1.2.3 ≠ refs/heads/dev) and
|
# cancelled, so a release build can't be cut off mid-flight.
|
||||||
# are never cancelled, so a release build can't kill itself mid-flight.
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ci-${{ github.ref }}
|
group: ci-${{ github.ref }}
|
||||||
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
cancel-in-progress: ${{ !startsWith(github.ref, 'refs/tags/') }}
|
||||||
@@ -91,10 +70,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache npm download cache
|
- name: Cache npm download cache
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
# Non-fatal: a transient cache-backend hiccup must NOT fail the whole
|
# Non-fatal: a cache-backend error just means installing without it.
|
||||||
# typecheck job (it was skipping install + type check and reporting red
|
|
||||||
# on backend-only pushes — see issue task #828). On cache miss/error the
|
|
||||||
# job just installs without the cache.
|
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
@@ -110,8 +86,7 @@ jobs:
|
|||||||
working-directory: frontend
|
working-directory: frontend
|
||||||
|
|
||||||
# Guards the one part of this repo that ships to users without a build step.
|
# Guards the one part of this repo that ships to users without a build step.
|
||||||
# See scripts/check_plugin.py for what it checks and, as importantly, what it
|
# scripts/check_plugin.py says what it checks and what it can't.
|
||||||
# can't check yet (shellcheck is absent from ci-python).
|
|
||||||
plugin:
|
plugin:
|
||||||
name: Plugin hooks
|
name: Plugin hooks
|
||||||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
@@ -119,25 +94,14 @@ jobs:
|
|||||||
container:
|
container:
|
||||||
image: git.fabledsword.com/bvandeusen/ci-python:3.14
|
image: git.fabledsword.com/bvandeusen/ci-python:3.14
|
||||||
steps:
|
steps:
|
||||||
# Bare `uses:`, no `with:` block. Adding one made this action fail to
|
# Keep this a bare `uses:`: with a `with:` block the action fails to
|
||||||
# extract on the act_runner ("Cannot find module .../dist/index.js") while
|
# extract on act_runner ("Cannot find module .../dist/index.js"). The
|
||||||
# every bare checkout in the same run succeeded — see run 3027. Nothing
|
# version check diffs two trees, so a depth-1 fetch of main is enough.
|
||||||
# here needs `fetch-depth: 0` anyway: the version check diffs two trees,
|
|
||||||
# and a tree diff needs both trees, not a common ancestor. A depth-1 fetch
|
|
||||||
# of main's tip is enough, and cheaper.
|
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# Per-job, not in the image, per CI-runner's docs/process.md: "If only one
|
# Per-job rather than in the image: Scribe is shellcheck's only consumer.
|
||||||
# project needs the dep, prefer that project installing it per-job in
|
# Install nothing else here; the hooks use only POSIX tools, and the
|
||||||
# their workflow — at least until a second consumer arrives." Scribe is
|
# smoke test runs on a bare image to prove it.
|
||||||
# the only consumer today. Promotion into ci-python is filed as an issue
|
|
||||||
# on CI-runner rather than assumed here.
|
|
||||||
#
|
|
||||||
# jq WAS installed here too, because every hook exited at line 1 without
|
|
||||||
# it and the smoke test would have passed while exercising nothing. The
|
|
||||||
# hooks need no jq since #4107 — they use only what POSIX guarantees — so
|
|
||||||
# the smoke test now runs on a bare image, which is the condition it is
|
|
||||||
# actually meant to be asserting.
|
|
||||||
- name: Install shell tooling
|
- name: Install shell tooling
|
||||||
run: |
|
run: |
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
@@ -163,28 +127,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
# ruff is pre-installed in the ci-python image — no install
|
# ruff is pre-installed in the ci-python image.
|
||||||
# step needed, lint runs in ~2s.
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: ruff check src/ scripts/
|
run: ruff check src/ scripts/
|
||||||
|
|
||||||
# Design tokens: does the frontend's CSS agree with the stylesheet the
|
# Checks the frontend's CSS against the committed, generated theme.css.
|
||||||
# design system generates? Fails only on an unresolvable var() reference —
|
# Fails only on an unresolvable var() reference; hard-coded literals are
|
||||||
# that count is at zero, so this is a ratchet rather than a backlog. The
|
# reported, not gated.
|
||||||
# literal findings are printed, not gated; hundreds exist and a
|
|
||||||
# permanently-red job is one nobody reads.
|
|
||||||
#
|
|
||||||
# Stdlib only, no install, no network: the source of truth is theme.css,
|
|
||||||
# which is generated from the design system and committed.
|
|
||||||
- name: Design token check
|
- name: Design token check
|
||||||
run: python3 scripts/check_design_tokens.py --report-literals
|
run: python3 scripts/check_design_tokens.py --report-literals
|
||||||
|
|
||||||
# Dangling styles: an element whose classes have only modifier rules and
|
# Reports elements whose classes have modifier rules but no base rule,
|
||||||
# no base — a deleted CSS rule that left its `:hover` behind. Two shipped
|
# which vue-tsc can't see. Not gated: a bare wrapper is legitimate, so
|
||||||
# this way (a link rendering as raw browser blue, a flex row whose parent
|
# the signal is the count growing.
|
||||||
# was gone so every child stacked). Neither is visible to vue-tsc; a dead
|
|
||||||
# style typechecks perfectly. Reported, not gated — a bare wrapper is
|
|
||||||
# legitimate, so the signal is the count growing.
|
|
||||||
- name: Dangling style check
|
- name: Dangling style check
|
||||||
run: python3 scripts/check_dangling_styles.py
|
run: python3 scripts/check_dangling_styles.py
|
||||||
|
|
||||||
@@ -201,63 +156,41 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/uv
|
path: ~/.cache/uv
|
||||||
# Keyed on the LOCK, not pyproject: the lock is what determines the
|
# Keyed on the lock, which decides the installed set.
|
||||||
# installed set now, and a pyproject edit that doesn't change
|
|
||||||
# resolution shouldn't throw the cache away.
|
|
||||||
key: uv-${{ hashFiles('uv.lock') }}
|
key: uv-${{ hashFiles('uv.lock') }}
|
||||||
restore-keys: uv-
|
restore-keys: uv-
|
||||||
|
|
||||||
# Installs exactly what uv.lock pins, and resolves nothing itself.
|
# Installs exactly what uv.lock pins, so green means these exact versions
|
||||||
#
|
# passed. `--locked` fails if the lock is stale against pyproject, so a
|
||||||
# This replaced `uv pip install -e ".[dev]"`, which resolved from the
|
# dependency change needs a deliberate `uv lock`.
|
||||||
# pyproject constraints and ignored the lock entirely. Every dependency
|
|
||||||
# floated: on 2026-07-28 mcp 2.0.0 shipped mid-session and turned `main`
|
|
||||||
# red with no repo change (issue #2194). Green CI has to mean "these exact
|
|
||||||
# versions passed", or it isn't evidence of anything.
|
|
||||||
#
|
|
||||||
# `--locked` also FAILS when uv.lock is stale against pyproject, so a
|
|
||||||
# dependency edit has to go through a deliberate `uv lock` — it can't
|
|
||||||
# arrive on its own. That check earned its place immediately: it caught
|
|
||||||
# that the lock had been missing `pgvector` entirely (added to pyproject,
|
|
||||||
# never re-locked), which the old install path had been silently papering
|
|
||||||
# over by resolving from pyproject instead.
|
|
||||||
- name: Install locked dependencies
|
- name: Install locked dependencies
|
||||||
env:
|
env:
|
||||||
UV_PROJECT_ENVIRONMENT: /opt/venv
|
UV_PROJECT_ENVIRONMENT: /opt/venv
|
||||||
run: uv sync --locked --extra dev
|
run: uv sync --locked --extra dev
|
||||||
|
|
||||||
# An "Install jq for hook execution tests" step stood here. The hook
|
# The hook execution tests run on a bare image (no jq), like a user's
|
||||||
# EXECUTION tests run the real bash hook, which exited silently without
|
# machine might be.
|
||||||
# jq and skipped rather than failed, so the step existed to stop them
|
|
||||||
# being silently unverified. Since #4107 the hooks need no jq, so the
|
|
||||||
# step is gone and those tests run against a bare image — and the point
|
|
||||||
# of removing a dependency is lost if CI keeps installing it anyway.
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
# Integration tests (real Postgres) run in the `integration` job below.
|
# Integration tests (real Postgres) run in the `integration` job below.
|
||||||
run: /opt/venv/bin/python -m pytest tests/ -q -m "not integration"
|
run: /opt/venv/bin/python -m pytest tests/ -q -m "not integration"
|
||||||
|
|
||||||
# Real-Postgres lane (family rule 6). Exercises the async SQLAlchemy connection
|
# Real Postgres, built by the real migrations: covers the async SQLAlchemy
|
||||||
# path the unit stubs can't reach — the un-awaited execution_options regression
|
# paths unit stubs can't reach.
|
||||||
# that made every VACUUM report 0/6 lived here. Like `test`, it runs for
|
|
||||||
# visibility and does NOT gate the build.
|
|
||||||
#
|
#
|
||||||
# Job key stays separator-free ("integration"): act_runner derives the service-
|
# Service hostnames aren't routable on this runner, so the step finds the
|
||||||
# container name from the (truncated) job display name and the discovery step
|
# Postgres container's bridge IP. The job has no `name:` and a separator-free
|
||||||
# filters `docker ps` by it. Service hostnames aren't routable on this runner,
|
# key because act_runner names service containers after it.
|
||||||
# so the step resolves the Postgres container's bridge IP. No `name:` on purpose.
|
|
||||||
integration:
|
integration:
|
||||||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: python-ci
|
runs-on: python-ci
|
||||||
container:
|
container:
|
||||||
image: git.fabledsword.com/bvandeusen/ci-python:3.14
|
image: git.fabledsword.com/bvandeusen/ci-python:3.14
|
||||||
env:
|
env:
|
||||||
# Config + the module engine read these at import time. DATABASE_URL itself
|
# Read at import time. DATABASE_URL is built from the discovered IP below.
|
||||||
# is built from the discovered service IP in the run step.
|
|
||||||
SECRET_KEY: ci_integration_placeholder
|
SECRET_KEY: ci_integration_placeholder
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
# pgvector image so `alembic upgrade head` can run migration 0067
|
# Same image as the shipped compose files: Postgres 17 with pgvector.
|
||||||
# (CREATE EXTENSION vector). PG17 — matches the prod/quickstart image.
|
|
||||||
image: pgvector/pgvector:pg17
|
image: pgvector/pgvector:pg17
|
||||||
env:
|
env:
|
||||||
POSTGRES_USER: scribe
|
POSTGRES_USER: scribe
|
||||||
@@ -270,25 +203,19 @@ jobs:
|
|||||||
--health-retries 10
|
--health-retries 10
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
# Same locked install as the unit lane — the two must agree on versions,
|
# Same locked install as the unit lane, so both test the same versions.
|
||||||
# or "unit green, integration red" stops being a signal about the code.
|
|
||||||
- name: Install locked dependencies
|
- name: Install locked dependencies
|
||||||
env:
|
env:
|
||||||
UV_PROJECT_ENVIRONMENT: /opt/venv
|
UV_PROJECT_ENVIRONMENT: /opt/venv
|
||||||
run: uv sync --locked --extra dev
|
run: uv sync --locked --extra dev
|
||||||
# Standing answers to the checks carried by rules 81 and 79 — two facts
|
# Prints two facts about the runner that the steps below depend on.
|
||||||
# about THIS runner that conditional rules assert as fact, and that
|
# Every command is guarded so the diagnostic can't fail the lane.
|
||||||
# otherwise need a throwaway job to confirm (#3237). Printing them on
|
- name: Runner facts (shell, service hostnames)
|
||||||
# every integration run makes the next rulebook sweep a log read.
|
|
||||||
# Rule 80's evidence is the container listing the next step already
|
|
||||||
# prints. Every command is guarded: a diagnostic that can break the lane
|
|
||||||
# it observes is worse than no diagnostic.
|
|
||||||
- name: Runner facts (rules 79 and 81)
|
|
||||||
run: |
|
run: |
|
||||||
echo "--- rule 81: which shell runs a run: step ---"
|
echo "--- which shell runs a run: step ---"
|
||||||
readlink -f /bin/sh || echo "/bin/sh: not a symlink"
|
readlink -f /bin/sh || echo "/bin/sh: not a symlink"
|
||||||
ps -p $$ -o comm= || true
|
ps -p $$ -o comm= || true
|
||||||
echo "--- rule 79: is a service reachable by its hostname yet? ---"
|
echo "--- is a service reachable by its hostname? ---"
|
||||||
getent hosts postgres \
|
getent hosts postgres \
|
||||||
|| echo "no — 'postgres' does not resolve; the bridge-IP lookup is still required"
|
|| echo "no — 'postgres' does not resolve; the bridge-IP lookup is still required"
|
||||||
- name: Integration suite (resolve service IP, migrate, test)
|
- name: Integration suite (resolve service IP, migrate, test)
|
||||||
@@ -296,12 +223,10 @@ jobs:
|
|||||||
set -eux
|
set -eux
|
||||||
echo "=== container landscape (diagnostic for the name filter) ==="
|
echo "=== container landscape (diagnostic for the name filter) ==="
|
||||||
docker ps -a --format '{{.ID}} {{.Image}} -> {{.Names}}'
|
docker ps -a --format '{{.ID}} {{.Image}} -> {{.Names}}'
|
||||||
# Only THIS job's services. The runner's docker daemon is shared, so another
|
# Only this job's services: the docker daemon is shared, so a job-name
|
||||||
# repo's job can be running beside this one, and a job-name filter matches its
|
# filter can match another repo's Postgres. act names a task's containers
|
||||||
# containers too (Steward run 8358 and Inkwell run 8653 each took another repo's
|
# GITEA-ACTIONS-TASK-<n>-...; read <n> from our own container (its id is in
|
||||||
# Postgres). act names every container of a task GITEA-ACTIONS-TASK-<n>-...: read
|
# the /etc/hostname bind mount) and require exactly one match.
|
||||||
# <n> from our own container (its id is in the /etc/hostname bind mount) and
|
|
||||||
# require exactly one match.
|
|
||||||
SELF=$(grep -o '/containers/[0-9a-f]\{64\}/' /proc/self/mountinfo | head -n1 | cut -d/ -f3 || true)
|
SELF=$(grep -o '/containers/[0-9a-f]\{64\}/' /proc/self/mountinfo | head -n1 | cut -d/ -f3 || true)
|
||||||
SELF=${SELF:-$(hostname)}
|
SELF=${SELF:-$(hostname)}
|
||||||
TASK=$(docker inspect -f '{{.Name}}' "$SELF" | grep -o 'GITEA-ACTIONS-TASK-[0-9]*-')
|
TASK=$(docker inspect -f '{{.Name}}' "$SELF" | grep -o 'GITEA-ACTIONS-TASK-[0-9]*-')
|
||||||
@@ -311,9 +236,7 @@ jobs:
|
|||||||
PG_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$PG")
|
PG_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' "$PG")
|
||||||
test -n "$PG_IP"
|
test -n "$PG_IP"
|
||||||
export DATABASE_URL="postgresql+asyncpg://scribe:ci_integration@${PG_IP}:5432/scribe_test"
|
export DATABASE_URL="postgresql+asyncpg://scribe:ci_integration@${PG_IP}:5432/scribe_test"
|
||||||
# Wait for Postgres to accept connections. The run: shell is dash
|
# Wait for Postgres. The run: shell is dash (no bash /dev/tcp), so use Python.
|
||||||
# (/bin/sh -> /usr/bin/dash on this Debian-based image, confirmed by
|
|
||||||
# the step above) — no bash /dev/tcp, so use Python.
|
|
||||||
/opt/venv/bin/python - "$PG_IP" <<'PY'
|
/opt/venv/bin/python - "$PG_IP" <<'PY'
|
||||||
import socket, sys, time
|
import socket, sys, time
|
||||||
for _ in range(30):
|
for _ in range(30):
|
||||||
@@ -332,21 +255,12 @@ jobs:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build & push image
|
name: Build & push image
|
||||||
# `plugin` is deliberately NOT in needs. The plugin isn't in the image —
|
# `plugin` is not in needs: the plugin ships from git, not in the image, so
|
||||||
# installs fetch it from git — so gating the server image on a hook lint
|
# holding the image back wouldn't stop a bad hook. A red `plugin` job still
|
||||||
# would couple two things that don't ship together, and blocking the build
|
# turns the run red. `integration` is: the image carries the migrations and
|
||||||
# wouldn't un-publish a bad hook anyway: the push already did that. A failed
|
# queries that lane tests.
|
||||||
# `plugin` job still turns the whole run red, which is the signal that
|
|
||||||
# matters.
|
|
||||||
#
|
|
||||||
# `integration` IS in needs (rule 177, #4958). It was added after this
|
|
||||||
# gate and left out of it, so on 2026-10-05 main run 8212 published
|
|
||||||
# :latest with integration red. The image carries the migrations and the
|
|
||||||
# queries that lane runs against real Postgres; a red integration run is
|
|
||||||
# a red image.
|
|
||||||
needs: [typecheck, lint, test, integration]
|
needs: [typecheck, lint, test, integration]
|
||||||
# Build on dev, main, and v* tag pushes. dev → :dev, main → :latest,
|
# dev → :dev, main → :latest, tag → :latest + :<version>; all get :<sha>.
|
||||||
# tag → :latest + :<version>; every build also gets an immutable :<sha>.
|
|
||||||
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: python-ci
|
runs-on: python-ci
|
||||||
container:
|
container:
|
||||||
@@ -357,53 +271,37 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
# Rule 149 asks for this on any job deriving the version NAME. The
|
# Full history for the version derivation. Today it needs only HEAD's
|
||||||
# name here comes from HEAD's commit TIME, which a depth-1 clone
|
# commit time, but a shallow clone fails silently (a too-low value) if
|
||||||
# already has — but the rule states it unconditionally because the
|
# the derivation ever reads further back.
|
||||||
# failure it guards is silent (a too-low value, every lane green),
|
|
||||||
# and a later change to how the name is derived would inherit the
|
|
||||||
# landmine rather than the guard.
|
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Generate image tags and version
|
- name: Generate image tags and version
|
||||||
id: tags
|
id: tags
|
||||||
# POSIX `case` instead of bash `[[ ]]` because act_runner invokes
|
# POSIX `case`, not bash `[[ ]]`: the run: shell is dash, where `[[`
|
||||||
# `sh -e` (dash on the ci-python:3.14 image, which has no bash on
|
# fails silently and only the :<sha> tag would be pushed.
|
||||||
# the default PATH for /bin/sh). Previous `[[ ]]` form failed
|
|
||||||
# silently — only the SHA tag got appended, so :dev / :latest
|
|
||||||
# never updated in the registry and the deployed stack kept
|
|
||||||
# pulling stale images. Verified via `[[: not found` lines in
|
|
||||||
# the runner log on commit 2a374d9.
|
|
||||||
run: |
|
run: |
|
||||||
TAGS="${{ env.IMAGE }}:${{ github.sha }}"
|
TAGS="${{ env.IMAGE }}:${{ github.sha }}"
|
||||||
|
|
||||||
# THREE VALUES, NEVER FOLDED TOGETHER (rule 149). Until 2026-08-31
|
# Three values kept separate; the Dockerfile describes each.
|
||||||
# BUILD_VERSION was the CHANNEL — "dev" / "main" / the tag — so the
|
|
||||||
# image self-reported {"version":"main"}, a channel name where a
|
|
||||||
# build identifier belongs. That cost a debugging session: with the
|
|
||||||
# deploy misbehaving, nothing on the running instance could say
|
|
||||||
# which commit was serving it.
|
|
||||||
|
|
||||||
# 1. ORDERING KEY — BUILD time, monotonic by construction. Minutes
|
# 1. Ordering key: build time in minutes since 2020-01-01, so it only
|
||||||
# since 2020-01-01. Never a commit count (not monotonic across
|
# goes up. Commit time would go down when an older commit is
|
||||||
# branches) and never commit time (goes DOWN when an older
|
# rebuilt; a commit count isn't monotonic across branches.
|
||||||
# commit is rebuilt).
|
|
||||||
BUILD_KEY=$(( ( $(date -u +%s) - 1577836800 ) / 60 ))
|
BUILD_KEY=$(( ( $(date -u +%s) - 1577836800 ) / 60 ))
|
||||||
|
|
||||||
# 2. NAME — COMMIT time, so the same source reports the same string
|
# 2. Name: commit time, so the same source reads the same on every lane.
|
||||||
# on every lane and the channel is the only thing that differs.
|
|
||||||
COMMIT_TS=$(git log --format=%ct -1 HEAD)
|
COMMIT_TS=$(git log --format=%ct -1 HEAD)
|
||||||
BUILD_NAME=$(date -u -d "@$COMMIT_TS" +%Y.%m.%d.%H%M)
|
BUILD_NAME=$(date -u -d "@$COMMIT_TS" +%Y.%m.%d.%H%M)
|
||||||
|
|
||||||
# 3. CHANNEL — its own value. Never a suffix, never a segment.
|
# 3. Channel: its own value, never part of the name.
|
||||||
CHANNEL="dev"
|
CHANNEL="dev"
|
||||||
case "${{ github.ref }}" in
|
case "${{ github.ref }}" in
|
||||||
refs/heads/dev)
|
refs/heads/dev)
|
||||||
TAGS="$TAGS,${{ env.IMAGE }}:dev"
|
TAGS="$TAGS,${{ env.IMAGE }}:dev"
|
||||||
;;
|
;;
|
||||||
refs/heads/main)
|
refs/heads/main)
|
||||||
# main IS the production line: publish :latest (plus the :<sha>
|
# main is the production line, so it publishes :latest.
|
||||||
# set above). No separate :main tag.
|
|
||||||
TAGS="$TAGS,${{ env.IMAGE }}:latest"
|
TAGS="$TAGS,${{ env.IMAGE }}:latest"
|
||||||
CHANNEL="stable"
|
CHANNEL="stable"
|
||||||
;;
|
;;
|
||||||
@@ -418,12 +316,8 @@ jobs:
|
|||||||
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
|
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Free disk space
|
- name: Free disk space
|
||||||
# Self-hosted runner housekeeping. Two-step cleanup:
|
# Prunes unused containers and images, and caps the BuildKit cache at
|
||||||
# 1. Prune dangling containers/images globally (stops the runner
|
# 5 GB so the package caches survive but old layers don't pile up.
|
||||||
# from accumulating cruft from past failed builds).
|
|
||||||
# 2. Trim the BuildKit layer cache to a 5GB ceiling so the pip
|
|
||||||
# mount cache survives but old intermediate layers don't
|
|
||||||
# accumulate indefinitely.
|
|
||||||
run: |
|
run: |
|
||||||
docker system prune -af || true
|
docker system prune -af || true
|
||||||
docker builder prune --keep-storage 5g -f || true
|
docker builder prune --keep-storage 5g -f || true
|
||||||
@@ -445,19 +339,13 @@ jobs:
|
|||||||
push: true
|
push: true
|
||||||
provenance: false
|
provenance: false
|
||||||
tags: ${{ steps.tags.outputs.value }}
|
tags: ${{ steps.tags.outputs.value }}
|
||||||
# All three, plus the commit — rule 145: the registry's identity for
|
# The commit lets the image's self-report be checked against :<sha>.
|
||||||
# a build (:<sha>) and the artifact's identity for itself must
|
|
||||||
# agree, and they can only be checked against each other if the
|
|
||||||
# artifact says which commit it is.
|
|
||||||
build-args: |
|
build-args: |
|
||||||
BUILD_VERSION=${{ steps.tags.outputs.build_name }}
|
BUILD_VERSION=${{ steps.tags.outputs.build_name }}
|
||||||
BUILD_KEY=${{ steps.tags.outputs.build_key }}
|
BUILD_KEY=${{ steps.tags.outputs.build_key }}
|
||||||
BUILD_CHANNEL=${{ steps.tags.outputs.channel }}
|
BUILD_CHANNEL=${{ steps.tags.outputs.channel }}
|
||||||
BUILD_COMMIT=${{ github.sha }}
|
BUILD_COMMIT=${{ github.sha }}
|
||||||
# Registry-backed layer cache. Pull from :cache to prime
|
# Layer cache kept in the registry, so a build starts warm even after
|
||||||
# BuildKit, push updated layers back to :cache so the next
|
# the runner prunes. `mode=max` caches intermediate layers too.
|
||||||
# build starts warm even if the runner's local cache was
|
|
||||||
# pruned. `mode=max` exports all intermediate layers, not
|
|
||||||
# just the final image, which is what gives the ~80% speedup.
|
|
||||||
cache-from: type=registry,ref=${{ env.IMAGE }}:cache
|
cache-from: type=registry,ref=${{ env.IMAGE }}:cache
|
||||||
cache-to: type=registry,ref=${{ env.IMAGE }}:cache,mode=max,ignore-error=true
|
cache-to: type=registry,ref=${{ env.IMAGE }}:cache,mode=max,ignore-error=true
|
||||||
|
|||||||
+11
-20
@@ -12,11 +12,8 @@ RUN npm run build
|
|||||||
FROM python:3.14-slim AS runtime
|
FROM python:3.14-slim AS runtime
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Installed from uv.lock, exactly like CI (issue #2194). This used to be
|
# Installed from uv.lock, exactly like CI, so the image runs the dependency
|
||||||
# `COPY pyproject.toml .` + `pip install .`, which never even copied the lock:
|
# versions CI tested.
|
||||||
# the shipped image resolved its own dependency set, so CI could be green on one
|
|
||||||
# set of versions while the published image ran another. On 2026-07-28 that
|
|
||||||
# class of drift turned `main` red when mcp 2.0.0 shipped mid-session.
|
|
||||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||||
pip install --no-cache-dir uv
|
pip install --no-cache-dir uv
|
||||||
|
|
||||||
@@ -41,21 +38,15 @@ COPY alembic/ alembic/
|
|||||||
# Ensure Python finds the source tree (where static files live) before site-packages
|
# Ensure Python finds the source tree (where static files live) before site-packages
|
||||||
ENV PYTHONPATH=/app/src
|
ENV PYTHONPATH=/app/src
|
||||||
|
|
||||||
# THREE VALUES, NEVER FOLDED TOGETHER (rule 149), plus the commit.
|
# Three values kept separate, plus the commit:
|
||||||
#
|
# BUILD_VERSION is the name (YYYY.MM.DD.HHMM from commit time), the same on
|
||||||
# BUILD_VERSION is the NAME (YYYY.MM.DD.HHMM, from COMMIT time) — the same
|
# every lane for the same source.
|
||||||
# string on every lane for the same source, so it answers "is this the same
|
# BUILD_KEY is the ordering key (minutes since 2020-01-01 from build time), the
|
||||||
# code?" rather than "which lane built it?".
|
# only value compared to decide which build is newer.
|
||||||
# BUILD_KEY is the ORDERING KEY (minutes since 2020-01-01, from BUILD time) —
|
# BUILD_CHANNEL is its own field, never part of the name.
|
||||||
# the only value anything may compare to decide what is newer.
|
# BUILD_COMMIT lets the image's self-report be checked against its :<sha> tag.
|
||||||
# BUILD_CHANNEL is its own field. Never a suffix, never a segment of the name.
|
# A local build leaves the key and channel empty: it has no place in an update
|
||||||
# BUILD_COMMIT lets the artifact's self-report be checked against the :<sha>
|
# order, and /api/version omits them.
|
||||||
# it was published under (rule 145).
|
|
||||||
#
|
|
||||||
# Each defaults to empty rather than to a placeholder, EXCEPT the name: a
|
|
||||||
# local build genuinely has no ordering key or channel, and the endpoint says
|
|
||||||
# so by omitting them. Inventing values would make a local image claim a
|
|
||||||
# position in an update order it is not part of.
|
|
||||||
ARG BUILD_VERSION=dev
|
ARG BUILD_VERSION=dev
|
||||||
ARG BUILD_KEY=
|
ARG BUILD_KEY=
|
||||||
ARG BUILD_CHANNEL=
|
ARG BUILD_CHANNEL=
|
||||||
|
|||||||
@@ -39,9 +39,8 @@ check: lint typecheck test
|
|||||||
|
|
||||||
# --- Plugin ---
|
# --- Plugin ---
|
||||||
|
|
||||||
# Run this after changing anything under plugin/ or .claude-plugin/, BEFORE
|
# Run after changing plugin/ or .claude-plugin/, before committing: the plugin
|
||||||
# committing. The plugin ships straight from git with no build step, so its
|
# ships from git with no build step, so its version is minted here. CI fails if
|
||||||
# version is minted here rather than stamped by CI; the lane fails if you
|
# the version wasn't bumped.
|
||||||
# forget, but this is what makes remembering cheap.
|
|
||||||
mint-plugin:
|
mint-plugin:
|
||||||
python3 scripts/mint_plugin_version.py
|
python3 scripts/mint_plugin_version.py
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export SECRET_KEY=your-random-secret-here
|
|||||||
docker compose -f docker-compose.quickstart.yml up -d
|
docker compose -f docker-compose.quickstart.yml up -d
|
||||||
```
|
```
|
||||||
|
|
||||||
Open `http://localhost:5000`. The first user to register becomes admin. To connect Claude, create an API key under **Settings → API Keys** and install the Claude Code plugin — see [API Keys & MCP](docs/api-keys-and-mcp.md).
|
Open `http://localhost:5000`. The first user to register becomes admin. To connect Claude, create an API key under **Settings → MCP Access** and install the Claude Code plugin — see [API Keys & MCP](docs/api-keys-and-mcp.md).
|
||||||
|
|
||||||
> **Development:** To build from source, see [Development](docs/development.md).
|
> **Development:** To build from source, see [Development](docs/development.md).
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ Open `http://localhost:5000`. The first user to register becomes admin. To conne
|
|||||||
| [Configuration](docs/configuration.md) | Environment variables, Docker Compose, production setup, security |
|
| [Configuration](docs/configuration.md) | Environment variables, Docker Compose, production setup, security |
|
||||||
| [Features](docs/features.md) | Detailed feature breakdown and keyboard shortcuts |
|
| [Features](docs/features.md) | Detailed feature breakdown and keyboard shortcuts |
|
||||||
| [Development](docs/development.md) | Dev workflow, CI/CD, migrations, release process |
|
| [Development](docs/development.md) | Dev workflow, CI/CD, migrations, release process |
|
||||||
| [API Keys & MCP](docs/api-keys-and-mcp.md) | API key management and Fable MCP install guide |
|
| [API Keys & MCP](docs/api-keys-and-mcp.md) | API keys and installing the Claude Code plugin |
|
||||||
| [SSO / OAuth](docs/sso-oauth.md) | OIDC setup for Authentik, Keycloak, and other providers |
|
| [SSO / OAuth](docs/sso-oauth.md) | OIDC setup for Authentik, Keycloak, and other providers |
|
||||||
| [API Reference](docs/api-reference.md) | All REST API endpoints |
|
| [API Reference](docs/api-reference.md) | All REST API endpoints |
|
||||||
|
|
||||||
|
|||||||
+12
-22
@@ -16,11 +16,10 @@ real Postgres), build (docker buildx).
|
|||||||
## Image deps used
|
## Image deps used
|
||||||
|
|
||||||
- python 3.14
|
- python 3.14
|
||||||
- node 24 (used for `npm ci` + `vue-tsc` in the typecheck job, and as the
|
- node 24 (`npm ci` + `vue-tsc` in the typecheck job; the production
|
||||||
frontend builder stage inside the production `Dockerfile`)
|
`Dockerfile` builds the frontend on `node:22-alpine`)
|
||||||
- ruff (lint job runs `ruff check src/` with zero install overhead)
|
- ruff (lint job runs `ruff check src/ scripts/` with zero install overhead)
|
||||||
- uv (test + integration jobs run `uv sync --locked`; installed in the
|
- uv (test + integration jobs run `uv sync --locked`)
|
||||||
image since the ci-python Dockerfile started pip-installing it)
|
|
||||||
- docker CLI + buildx (build job pushes the production image to the
|
- docker CLI + buildx (build job pushes the production image to the
|
||||||
Fabled-Git registry)
|
Fabled-Git registry)
|
||||||
|
|
||||||
@@ -30,24 +29,15 @@ Anything CI installs at job time that isn't in the image. Promotion
|
|||||||
candidates if more than one project needs them.
|
candidates if more than one project needs them.
|
||||||
|
|
||||||
- `shellcheck` — apt-installed in the **plugin** job, which lints the
|
- `shellcheck` — apt-installed in the **plugin** job, which lints the
|
||||||
Claude Code hook scripts and runs their fail-open smoke test. Per
|
Claude Code hook scripts and runs their fail-open smoke test. Scribe is
|
||||||
`docs/process.md`'s decision checkpoint, single-consumer deps stay
|
its only consumer, so per `docs/process.md` it stays per-job. It is small
|
||||||
per-job until a second consumer wants them; Scribe is the only one so
|
(~20 MB) and a promotion candidate once another project lints shell.
|
||||||
far. It is small (~20 MB) and would be a promotion candidate the moment
|
|
||||||
another project lints shell.
|
|
||||||
|
|
||||||
- `jq` — **no longer installed anywhere, and should not be promoted.**
|
The hooks ship to users' machines, so they use only POSIX tools (awk, sed,
|
||||||
It was installed in two jobs, and this file used to record it as "load-
|
tr, od, cut, head, tail, grep, sort, date, printf) plus `git` and `curl`.
|
||||||
bearing for the smoke test specifically", because every hook opened
|
The smoke test runs on a bare image to keep it that way: a tool such as `jq`
|
||||||
`command -v jq || exit 0` and the test would otherwise pass while
|
is missing on macOS, slim Debian/Ubuntu and Alpine, and a hook that needed it
|
||||||
exercising nothing. That was the tail wagging the dog: the hooks ship to
|
would give those machines nothing.
|
||||||
users, jq is absent by default on macOS, the Debian/Ubuntu slim images,
|
|
||||||
Alpine and most CI containers, and a machine without it got no context,
|
|
||||||
no rules, no prior art and no process sync in silence. #4107 removed the
|
|
||||||
dependency rather than documenting it, so the smoke test now runs on a
|
|
||||||
bare image — which is the condition it was always meant to assert. The
|
|
||||||
hooks use only POSIX tools (awk, sed, tr, od, cut, head, tail, grep,
|
|
||||||
sort, date, printf) plus `git` and `curl`.
|
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ services:
|
|||||||
max_attempts: 5
|
max_attempts: 5
|
||||||
|
|
||||||
db:
|
db:
|
||||||
# pgvector image (Debian/glibc, PG17) — bundles the `vector` extension that
|
# Postgres 17 with the vector extension Scribe needs.
|
||||||
# migration 0067 enables. Moved off postgres:16-alpine via logical
|
|
||||||
# dump/restore (which doubles as the PG16->PG17 major upgrade); see the
|
|
||||||
# TRANSITION runbook in the PR.
|
|
||||||
image: pgvector/pgvector:pg17
|
image: pgvector/pgvector:pg17
|
||||||
stop_grace_period: 120s
|
stop_grace_period: 120s
|
||||||
volumes:
|
volumes:
|
||||||
@@ -35,9 +32,8 @@ services:
|
|||||||
POSTGRES_DB: scribe
|
POSTGRES_DB: scribe
|
||||||
networks:
|
networks:
|
||||||
- scribe_backend
|
- scribe_backend
|
||||||
# Lenient by design: a transient host exec/healthcheck stall (incident:
|
# Lenient on purpose: health only orders app startup, so a stalled check
|
||||||
# runc setns failures -> "unhealthy" -> SIGKILL -> crash loop) must never
|
# must not get the database killed.
|
||||||
# escalate to killing the DB. Health here only gates app startup order.
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U scribe"]
|
test: ["CMD-SHELL", "pg_isready -U scribe"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
@@ -1,16 +1,7 @@
|
|||||||
# Fabled Scribe — Quick Start
|
# Fabled Scribe from the pre-built image:
|
||||||
#
|
# docker compose -f docker-compose.quickstart.yml up -d
|
||||||
# No build required. Pulls the latest pre-built image from the registry.
|
# Then open http://localhost:5000 (the first account registered becomes admin)
|
||||||
#
|
# and connect Claude from Settings → MCP Access.
|
||||||
# Usage:
|
|
||||||
# 1. Download this file
|
|
||||||
# 2. docker compose -f docker-compose.quickstart.yml up -d
|
|
||||||
# 3. Open http://localhost:5000 — the first account registered becomes admin
|
|
||||||
# 4. Go to Settings → MCP Access and connect Claude (Code or Desktop) via the
|
|
||||||
# bearer-token URL shown there.
|
|
||||||
#
|
|
||||||
# Set SECRET_KEY via environment variable or a .env file alongside this file:
|
|
||||||
# SECRET_KEY=your-random-secret-here
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
@@ -19,6 +10,7 @@ services:
|
|||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "postgresql+asyncpg://scribe:scribe@db:5432/scribe"
|
DATABASE_URL: "postgresql+asyncpg://scribe:scribe@db:5432/scribe"
|
||||||
|
# Set SECRET_KEY in the environment or a .env file beside this one.
|
||||||
SECRET_KEY: "${SECRET_KEY:-change-me-in-production}"
|
SECRET_KEY: "${SECRET_KEY:-change-me-in-production}"
|
||||||
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
LOG_LEVEL: "${LOG_LEVEL:-INFO}"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -35,7 +27,7 @@ services:
|
|||||||
start_period: 30s
|
start_period: 30s
|
||||||
|
|
||||||
db:
|
db:
|
||||||
# pgvector image (PG17) — bundles the `vector` extension (migration 0067).
|
# Postgres 17 with the vector extension Scribe needs.
|
||||||
image: pgvector/pgvector:pg17
|
image: pgvector/pgvector:pg17
|
||||||
stop_grace_period: 120s
|
stop_grace_period: 120s
|
||||||
volumes:
|
volumes:
|
||||||
@@ -44,8 +36,8 @@ services:
|
|||||||
POSTGRES_USER: scribe
|
POSTGRES_USER: scribe
|
||||||
POSTGRES_PASSWORD: scribe
|
POSTGRES_PASSWORD: scribe
|
||||||
POSTGRES_DB: scribe
|
POSTGRES_DB: scribe
|
||||||
# Lenient by design: a transient host exec/healthcheck stall must never
|
# Lenient on purpose: health only orders app startup, so a stalled check
|
||||||
# escalate to killing the DB. Health here only gates app startup order.
|
# must not get the database killed.
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U scribe"]
|
test: ["CMD-SHELL", "pg_isready -U scribe"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
+4
-5
@@ -8,13 +8,12 @@ services:
|
|||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
volumes:
|
volumes:
|
||||||
- app_data:/data
|
- app_data:/data
|
||||||
# To use a bind mount instead (gives direct host access to all app data):
|
# Or a bind mount, for direct host access to the app's data:
|
||||||
# - ./data:/data
|
# - ./data:/data
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: "postgresql+asyncpg://${POSTGRES_USER:-scribe}:${POSTGRES_PASSWORD:-scribe}@db:5432/${POSTGRES_DB:-scribe}"
|
DATABASE_URL: "postgresql+asyncpg://${POSTGRES_USER:-scribe}:${POSTGRES_PASSWORD:-scribe}@db:5432/${POSTGRES_DB:-scribe}"
|
||||||
SECRET_KEY: "${SECRET_KEY:-dev-secret-change-me}"
|
SECRET_KEY: "${SECRET_KEY:-dev-secret-change-me}"
|
||||||
# Uncomment if you have a SearXNG instance you want to surface in the
|
# Optional: a SearXNG instance to list as the web-search backend in Integrations.
|
||||||
# Integrations tab as a configured web-search backend:
|
|
||||||
# SEARXNG_URL: "http://searxng:8080"
|
# SEARXNG_URL: "http://searxng:8080"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/health')"]
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:5000/api/health')"]
|
||||||
@@ -33,8 +32,8 @@ services:
|
|||||||
POSTGRES_USER: ${POSTGRES_USER:-scribe}
|
POSTGRES_USER: ${POSTGRES_USER:-scribe}
|
||||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-scribe}
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-scribe}
|
||||||
POSTGRES_DB: ${POSTGRES_DB:-scribe}
|
POSTGRES_DB: ${POSTGRES_DB:-scribe}
|
||||||
# Lenient by design: a transient host exec/healthcheck stall must never
|
# Lenient on purpose: health only orders app startup, so a stalled check
|
||||||
# escalate to killing the DB. Health here only gates app startup order.
|
# must not get the database killed.
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-scribe}"]
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-scribe}"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|||||||
Reference in New Issue
Block a user