Commit Graph

10 Commits

Author SHA1 Message Date
6c0ecded47 fix: automatic DB migration — run before backend starts
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 3s
Three fixes to ensure alembic migrations always run in production:

1. entrypoint.sh: add `exec "$@"` passthrough so `docker compose run
   --rm backend alembic upgrade head` actually runs alembic instead of
   ignoring args and starting uvicorn.

2. entrypoint.sh: remove `|| echo` fallback on alembic — if migration
   fails the container must stop, not silently continue.

3. deploy.yml: start only postgres+redis first, run migration, THEN
   start backend. Previously the backend started before migration,
   ran with stale schema, and the separate migration step was broken
   by the entrypoint bug.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 11:03:42 +02:00
413f610f1a feat: production CI/CD with DB backup and auto-rollback
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2s
8-step pipeline:
1. Git pull
2. pg_dumpall + gzip backup (keep last 10)
3. Build images (with cache)
4. Start services
5. Wait for postgres
6. Run alembic migration (one-shot container)
   - On failure: auto-restore DB from backup
7. Health check backend
   - On failure: auto-rollback DB + restart
8. Summary with backup path

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 10:02:36 +02:00
392418c3f9 fix: run alembic migration in one-shot container before backend start
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 1m1s
- Use 'docker compose run --rm backend alembic upgrade head' to run
  migration in a throwaway container (doesn't need backend running)
- Restore entrypoint migration fallback (don't block startup)
- Restart backend after migration to pick up schema changes
- Remove --no-cache (too slow, was causing timeouts)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 09:59:20 +02:00
f409ccc647 fix: force --no-cache on docker build to pick up all dependency changes
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 2m39s
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 01:38:07 +02:00
3069cf5928 fix: add explicit alembic migration step to CI pipeline
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 52s
Entrypoint migration can fail silently. Now runs explicitly:
  1. Wait for postgres
  2. alembic upgrade head (explicit, fails the deploy if broken)
  3. Wait for backend healthy

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 01:28:55 +02:00
20e8565929 fix: merge monitoring into main docker-compose.yml
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 51s
All services (app + Prometheus + Grafana + node-exporter + cAdvisor)
are now in a single docker-compose.yml. One `docker compose up -d`
starts everything. No more separate monitoring file needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:39:26 +02:00
a77b500e50 fix: merge monitoring deploy into single job
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 51s
Monitoring was in a separate blocked job. Now everything runs in one
SSH session so Prometheus + Grafana always deploy with the app.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 15:23:17 +02:00
38b59ba48d fix: rewrite deploy workflow to use SSH-based deployment
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 2m20s
Deploy to Production / Deploy Monitoring (push) Has been skipped
Use ubuntu-24.04 runner with SSH to 192.168.1.151 (same pattern as
memento project). Self-hosted runner is not needed on the server.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:53:15 +02:00
26dfa08730 feat: add Prometheus metrics + fix CI/CD health check port
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
- Add prometheus-client dependency
- Create middleware/metrics.py with PrometheusMiddleware
- Expose /metrics endpoint in Prometheus text format
- Track http_requests_total, translation_total, translation_duration_seconds,
  file_size_bytes
- Instrument translate routes with record_translation() and record_file_size()
- Fix deploy.yml health check: localhost:8000 -> localhost:8001 (Portainer conflict)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 14:33:10 +02:00
f79a4303ac ci: add Gitea Actions self-hosted deployment workflow
Some checks failed
Deploy to Homelab / Deploy Wordly to 192.168.1.151 (push) Has been cancelled
Deploy to Homelab / Deploy Monitoring (if configured) (push) Has been cancelled
Auto-deploys to 192.168.1.151 on push to production-deployment:
- Builds backend and frontend Docker images
- Starts all services with health checks
- Optionally deploys monitoring stack
- Cleans up old images

Requires a self-hosted runner on the target server.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 11:53:41 +02:00