Adds missing standard artifacts: - README.md (if missing) - AGENTS.md (AI agent contract) - PLAN.md (current sprint) - STATUS.md (where we are) - DEVELOPMENT.md (dev workflow) - DEPLOYMENT.md (deploy procedure) - TESTING.md (test strategy) - DECISIONS.md (ADR index + templates) - .github/CODEOWNERS - .github/workflows/ci.yml Preserves all existing artifacts. Refs: RugMunchMedia/fleet-template
1.6 KiB
1.6 KiB
DEPLOYMENT.md — PryScraper
How to deploy. Build, push, restart, rollback.
Architecture
- Container: Docker
- Image registry: local (Talos)
- Orchestration: docker-compose on Talos
- Reverse proxy: nginx on Talos
- Auto-deploy: forgejo webhook → Talos deploy script
Deploy
Automatic (CI/CD)
On merge to main:
- forgejo webhook fires
- Talos deploy script pulls latest commit
- Rebuilds Docker image
- Stops old container, starts new
- Runs health check
- Rolls back on failure
Manual
ssh netcup
cd /srv/pryscraper
git pull origin main
docker build -t pryscraper:latest .
docker stop pryscraper
docker rm pryscraper
docker run -d --name pryscraper --restart unless-stopped --network host -p 8005:8005 pryscraper:latest
Health Check
curl -fsS http://localhost:8005/health
Rollback
ssh netcup
cd /srv/pryscraper
git log --oneline -5 # find last good commit
git checkout <commit-hash>
docker build -t pryscraper:latest .
docker restart pryscraper
Logs
docker logs pryscraper --tail 100 -f
Monitoring
- Prometheus:
/metricsendpoint - Grafana: dashboards in fleet-infra
- Loki: log aggregation
Secrets
All secrets in gopass:
rmi/pryscraper/admin_keyrmi/pryscraper/db_password- see AGENTS.md for full list
Loaded via docker --env-file or systemd EnvironmentFile.
Firewall
- Public: 80, 443 (nginx)
- Internal: 8005 (localhost only, behind nginx)
- Tailscale: 8005 for admin access
Backup
- Code: forgejo (source of truth) + Hydra bare mirror (daily 04:00)
- Data: DB snapshot to R2 (daily)
- Config: gopass