be0c8bceb6
- Volume data/ (bind mount ./data) remplace le volume uploads nommé
data/notes/ → .md auto-générés, data/uploads/ → médias, data/backup/ → dumps
- Service Redis (redis:7-alpine) + worker ARQ (backend-worker)
- notes_markdown.py : frontmatter YAML + contenu + pièces jointes (liens relatifs)
Nom : YYYY-MM-DD_slug-titre_shortid.md, rotation si titre modifié
- api/notes.py : publie export_note_markdown / remove_note_markdown sur Redis
après chaque create / update / delete / add_attachment / delete_attachment
- api/admin.py : POST /backup, GET /backups, POST /restore/{filename} (pg_dump/pg_restore)
- Backend Dockerfile : postgresql-client ; requirements : arq==0.26.1
- ConfigPage : section "Base de données" avec sauvegarde + liste + restauration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
72 lines
1.5 KiB
YAML
72 lines
1.5 KiB
YAML
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_USER: homehub
|
|
POSTGRES_PASSWORD: homehub
|
|
POSTGRES_DB: homehub
|
|
volumes:
|
|
- db_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U homehub"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
backend:
|
|
build: ./backend
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://homehub:homehub@db:5432/homehub
|
|
UPLOAD_DIR: /data/uploads
|
|
DATA_DIR: /data
|
|
REDIS_URL: redis://redis:6379
|
|
CORS_ORIGINS: http://localhost:3001,http://localhost:3000
|
|
volumes:
|
|
- ./backend/app:/app/app
|
|
- ./data:/data
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
backend-worker:
|
|
build: ./backend
|
|
command: arq app.workers.notes_worker.WorkerSettings
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://homehub:homehub@db:5432/homehub
|
|
UPLOAD_DIR: /data/uploads
|
|
DATA_DIR: /data
|
|
REDIS_URL: redis://redis:6379
|
|
volumes:
|
|
- ./backend/app:/app/app
|
|
- ./data:/data
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
ports:
|
|
- "3001:80"
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
db_data:
|
|
redis_data:
|