mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-11 17:29:37 +02:00
Ajout des outils de migration et documentation: - scripts/verify-postgres-connection.js: Test connexion PostgreSQL - scripts/run-migration.sh: Script automatique de migration - docker-compose.yml: Volume mount pour accès SQLite depuis container - MIGRATION-STEPS.md: Guide pas-à-pas complet de migration La migration peut maintenant être lancée avec: docker-compose build notes-app docker-compose up -d bash scripts/run-migration.sh
66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: noteflow-postgres
|
|
restart: unless-stopped
|
|
command: -p 5499
|
|
environment:
|
|
POSTGRES_DB: noteflow
|
|
POSTGRES_USER: noteflow
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-noteflow_secure_password_change_me}
|
|
POSTGRES_INITDB_ARGS: "--encoding=UTF8"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
ports:
|
|
- "5499:5499"
|
|
networks:
|
|
- nginx_default
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U noteflow -d noteflow -p 5499"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# NoteFlow Application
|
|
notes-app:
|
|
build: .
|
|
container_name: notes-todo-app
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- "2222:2222"
|
|
volumes:
|
|
- notes_uploads:/app/public/uploads
|
|
- notes_logs:/app/data/logs
|
|
- ./data:/app/data-sqlite:ro # Mount SQLite DB for migration (read-only)
|
|
environment:
|
|
- NODE_ENV=production
|
|
- JWT_SECRET=${JWT_SECRET:-change_me_in_production_please_use_strong_secret}
|
|
- PORT=2222
|
|
- UPLOADS_PATH=/app/public/uploads
|
|
# PostgreSQL connection
|
|
- DATABASE_URL=postgresql://noteflow:${POSTGRES_PASSWORD:-noteflow_secure_password_change_me}@postgres:5499/noteflow
|
|
- DB_TYPE=postgres
|
|
networks:
|
|
- nginx_default
|
|
healthcheck:
|
|
test: ["CMD", "node", "-e", "require('http').get('http://localhost:2222/health', (r) => process.exit(r.statusCode === 200 ? 0 : 1))"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 40s
|
|
|
|
volumes:
|
|
postgres_data:
|
|
notes_uploads:
|
|
notes_logs:
|
|
|
|
networks:
|
|
nginx_default:
|
|
external: true
|