Skip to content

🧹 Dockerize and automate SQLite backups #31

@fusion94

Description

@fusion94

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

  • docker compose up runs the full stack locally.
  • DB and uploads survive container restarts via volumes.
  • Backup files appear in the configured directory on the documented schedule.
  • Restore-from-backup procedure documented in deployment.md.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions