Summary
Today the deployment story (deployment.md) is "manually git pull + npm install + systemd restart, copy the SQLite file by hand for backups." That's brittle. Containerize the stack and run automated backups.
Proposed Approach
Containers
Dockerfile for frontend (multi-stage Vite build + nginx serving the dist).
Dockerfile for backend (node:20-alpine, copy server/, install, run node index.js).
docker-compose.yml wiring both, plus a named volume for server/data/users.db and server/uploads/.
- Nginx in the frontend image proxies
/api and /uploads to the backend container.
Backups
- A small sidecar container (or cron job in the backend) running
sqlite3 users.db ".backup /backups/users-$(date +%F-%H%M).db" every N hours.
- Optional: upload to S3/B2 with
rclone (env-configurable bucket/credentials).
- Keep N most recent local copies; older ones rotated.
Docs
- Update
deployment.md to point at docker compose up -d as the primary path.
- Document backup retention and restore procedure.
Acceptance Criteria
Summary
Today the deployment story (
deployment.md) is "manually git pull + npm install + systemd restart, copy the SQLite file by hand for backups." That's brittle. Containerize the stack and run automated backups.Proposed Approach
Containers
Dockerfilefor frontend (multi-stage Vite build + nginx serving the dist).Dockerfilefor backend (node:20-alpine, copy server/, install, runnode index.js).docker-compose.ymlwiring both, plus a named volume forserver/data/users.dbandserver/uploads/./apiand/uploadsto the backend container.Backups
sqlite3 users.db ".backup /backups/users-$(date +%F-%H%M).db"every N hours.rclone(env-configurable bucket/credentials).Docs
deployment.mdto point atdocker compose up -das the primary path.Acceptance Criteria
docker compose upruns the full stack locally.deployment.md.