- Ajout scripts/ reproduisant chaque étape (secrets, render config, up CLI, init Garage, bootstrap prod, admin, vérif E2E, adoption Coolify, backup) - Templates envsubst (config.yml, garage.toml, cantaloupe.properties) + .example - deploy.conf (config non-secrète : domaine, versions, uuids Coolify) - docs/ : ARCHITECTURE, TROUBLESHOOTING (11 problèmes/fixes), RUNBOOK, SECURITY - Makefile (raccourcis) - .gitignore + retrait du suivi de .env/.secrets.env/config.yml/garage.toml (fichiers conservés sur disque ; secrets restent dans l'historique -> voir SECURITY.md) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
77 lines
2.6 KiB
Markdown
77 lines
2.6 KiB
Markdown
# Runbook — exploitation (day-2)
|
|
|
|
> En mode Coolify, les conteneurs ont le suffixe `-tdquwauzxsq0985fk9kjqqys` (cf. `deploy.conf`
|
|
> `CONTAINER_SUFFIX`). Les helpers `scripts/*.sh` le gèrent automatiquement via `cname`.
|
|
|
|
## Consulter / piloter
|
|
```bash
|
|
docker ps --filter name=ark- # état
|
|
docker logs -f ark-backend-<suffix> # logs backend
|
|
docker logs -f ark-worker-<suffix> # logs worker (tâches)
|
|
# depuis Coolify : dashboard -> projet arkindex -> service arkindex (Deploy / Logs / Restart)
|
|
```
|
|
|
|
## Redémarrer / redéployer
|
|
```bash
|
|
# CLI :
|
|
cd ~/arkindex-deploy && docker compose restart backend
|
|
# Coolify (API) :
|
|
curl -s -X POST -H "Authorization: Bearer $(cat ~/.ark_coolify_token)" \
|
|
"http://localhost:8000/api/v1/deploy?uuid=tdquwauzxsq0985fk9kjqqys"
|
|
```
|
|
|
|
## Mettre à jour Arkindex (nouvelle version d'image)
|
|
1. Vérifier la dernière finale (cf. Troubleshooting P1).
|
|
2. Changer les tags dans `docker-compose.coolify.yml` (backend/front) + `deploy.conf`.
|
|
3. En Coolify : mettre à jour le compose du service (UI ou API) puis redéployer.
|
|
4. **Toujours** relancer les migrations :
|
|
```bash
|
|
docker exec ark-backend-<suffix> arkindex migrate
|
|
```
|
|
|
|
## Shell Django / admin
|
|
```bash
|
|
docker exec -it ark-backend-<suffix> arkindex shell
|
|
docker exec -it ark-backend-<suffix> arkindex createsuperuser # (interactif)
|
|
scripts/40-create-admin.sh # (scripté, idempotent)
|
|
```
|
|
|
|
## Recherche (Solr)
|
|
```bash
|
|
# (re)indexer un corpus après import de données
|
|
docker exec ark-backend-<suffix> arkindex reindex --corpus-id <UUID> --drop
|
|
# tout réindexer
|
|
docker exec ark-backend-<suffix> arkindex reindex --all
|
|
```
|
|
|
|
## Stockage S3 (Garage)
|
|
```bash
|
|
G=ark-garage-<suffix>
|
|
docker exec $G /garage bucket list
|
|
docker exec $G /garage bucket info staging
|
|
docker exec $G /garage stats
|
|
```
|
|
|
|
## Sauvegardes
|
|
```bash
|
|
scripts/99-backup-db.sh # pg_dump + inventaire buckets -> backups/
|
|
# volumes gérés par Coolify : arkindex-deploy_* (anciens, backup) et <uuid>_* (actifs)
|
|
docker volume ls | grep -E 'arkindex-deploy_|tdquwauzxsq'
|
|
```
|
|
|
|
## Nettoyage des anciens volumes CLI (après validation Coolify)
|
|
```bash
|
|
docker volume rm arkindex-deploy_pgdata arkindex-deploy_redisdata \
|
|
arkindex-deploy_solrdata arkindex-deploy_garagedata
|
|
```
|
|
|
|
## Santé / vérification complète
|
|
```bash
|
|
ADMIN_PASS='…' scripts/50-verify.sh
|
|
```
|
|
|
|
## Mémoire serrée ?
|
|
- Soupape : désactiver la recherche → `features.search: no` dans `config.yml`, retirer le service
|
|
`ark-solr`, redéployer. Solr est le plus gros consommateur (~450 Mo).
|
|
- Le swap (4 Go) absorbe les pics ; surveiller `free -h` et `docker stats`.
|