Three things, all needed before the update loop can be tested. The public signing key is committed. Verified before trusting it: algorithm `Ed`, key ID 90E96FEA2F6D9B6A matching its own comment, 32-byte Ed25519 key. Dev builds now carry a version that RISES. Every build took its version from Cargo.toml, so each one was 0.1.0 — an installed 0.1.0 would read a manifest advertising 0.1.0, conclude it was current, and never update. The rolling channel would have looked broken while working exactly as written. Dev builds are now 0.1.<ci-run-number>, from one helper shared by both bundle jobs and the manifest writer, because three separate derivations of "what version is this" is three chances for the binary and the manifest to disagree. Plain semver, not a `-dev.N` prerelease: prerelease versions sort BELOW the release they qualify, so a tagged build would never update to a newer dev one, and Windows installer metadata wants a numeric X.Y.Z regardless. Bumping the minor still beats any dev build on the old line — 0.2.0 > 0.1.2932. The Windows job also gets the signing environment it was missing, so its NSIS installer is signed too. Without that the manifest would have had a Linux entry and nothing for the platform actually being tested. docker-compose.yml is now the production stack, per request: it pulls the published image instead of building, keeps Postgres OFF the host network, sets restart policies, health checks and log rotation, and refuses to start without a POSTGRES_PASSWORD rather than shipping a known one. Volume names are deliberately unchanged so an existing deployment upgrades in place instead of silently coming up against an empty database. Development keeps its own clearly-named file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SreJkbxB4gx8pPsu8QbLPi
72 lines
2.2 KiB
YAML
72 lines
2.2 KiB
YAML
# Hot-reload DEV stack: Postgres + backend (hypercorn --reload) + Vite dev server.
|
|
# Edit code on the host and changes reload live. Per family rule 12 the agent does
|
|
# NOT start this — run it yourself:
|
|
#
|
|
# docker compose -f docker-compose.dev.yml up
|
|
#
|
|
# Then open http://localhost:5173 (the Vite dev server proxies /api to the backend).
|
|
#
|
|
# docker-compose.yml — the DEFAULT file — is the production stack instead: it pulls
|
|
# the published image, keeps Postgres off the host network, and expects a .env. This
|
|
# one builds nothing and is deliberately insecure-by-convenience (weak password,
|
|
# Postgres published on 5432) because it is meant for a laptop, not a deployment.
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: thoughtsync
|
|
POSTGRES_PASSWORD: thoughtsync
|
|
POSTGRES_DB: thoughtsync
|
|
volumes:
|
|
- thoughtsync-dev-db:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U thoughtsync"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
api:
|
|
image: python:3.12-slim
|
|
working_dir: /app
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
environment:
|
|
THOUGHTSYNC_DATABASE_URL: postgresql+asyncpg://thoughtsync:thoughtsync@db:5432/thoughtsync
|
|
PYTHONPATH: /app/src
|
|
volumes:
|
|
- ./pyproject.toml:/app/pyproject.toml
|
|
- ./alembic.ini:/app/alembic.ini
|
|
- ./alembic:/app/alembic
|
|
- ./src:/app/src
|
|
- thoughtsync-dev-data:/var/thoughtsync
|
|
ports:
|
|
- "5000:5000"
|
|
# Install deps, wait for the DB, run migrations, then serve with live reload.
|
|
command: >
|
|
sh -c "pip install --quiet -e . &&
|
|
python -m thoughtsync.dbwait &&
|
|
alembic upgrade head &&
|
|
hypercorn 'thoughtsync.app:create_app()' --bind 0.0.0.0:5000 --reload"
|
|
|
|
web:
|
|
image: node:22-alpine
|
|
working_dir: /app
|
|
depends_on:
|
|
- api
|
|
environment:
|
|
# Vite proxies /api to the backend service (see frontend/vite.config.ts).
|
|
VITE_API_TARGET: http://api:5000
|
|
volumes:
|
|
- ./frontend:/app
|
|
- /app/node_modules
|
|
ports:
|
|
- "5173:5173"
|
|
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
|
|
|
|
volumes:
|
|
thoughtsync-dev-db:
|
|
thoughtsync-dev-data:
|