From 9997fa38f5ce8fcff23617a196243949b707eb2a Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 21:59:39 +0000 Subject: [PATCH] Simplify setup using a single Docker Compose file for all environments Consolidates Docker Compose configurations into a single docker-compose.yml file, removing docker-compose.simple.yml and docker-compose.prod.yml. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/b677ee4d-d452-4e7b-9ac9-ca1e468cd60b.jpg --- INSTALL_SIMPLE.md | 2 +- NETWORK_CONFIG.md | 66 +++++++---------------- QUICK_START.md | 2 +- deploy-prod.sh | 2 +- docker-compose.prod.yml | 107 -------------------------------------- docker-compose.simple.yml | 68 ------------------------ docker-compose.yml | 4 +- install-simple.sh | 2 +- replit.md | 2 + 9 files changed, 27 insertions(+), 228 deletions(-) delete mode 100644 docker-compose.prod.yml delete mode 100644 docker-compose.simple.yml diff --git a/INSTALL_SIMPLE.md b/INSTALL_SIMPLE.md index e5f665d..4fd06d7 100644 --- a/INSTALL_SIMPLE.md +++ b/INSTALL_SIMPLE.md @@ -16,7 +16,7 @@ RegisFlow est maintenant configuré pour une installation complètement automati ### Option 2 : Installation manuelle ```bash -# Construire et démarrer (configuration simple) +# Construire et démarrer docker-compose build docker-compose up -d ``` diff --git a/NETWORK_CONFIG.md b/NETWORK_CONFIG.md index 6c300c4..c9e2be6 100644 --- a/NETWORK_CONFIG.md +++ b/NETWORK_CONFIG.md @@ -4,11 +4,11 @@ Le sous-réseau `172.20.0.0/24` peut créer des conflits avec des réseaux existants sur certains systèmes. Pour éviter ces problèmes, RegisFlow propose plusieurs configurations. -## 🔧 Options de Configuration +## 🔧 Configuration Simplifiée -### Option 1 : Installation Simple (Recommandée) +### Configuration Unique -**Fichier** : `docker-compose.simple.yml` +**Fichier** : `docker-compose.yml` ```yaml # Utilise le réseau par défaut de Docker @@ -21,43 +21,14 @@ networks: - Aucun conflit de sous-réseau - Docker gère automatiquement les adresses IP - Configuration la plus simple -- Idéal pour tests et développement +- Compatible avec tous les environnements **Utilisation** : ```bash -docker-compose -f docker-compose.simple.yml up -d +docker-compose up -d ``` -### Option 2 : Configuration Sécurisée - -**Fichier** : `docker-compose.yml` - -```yaml -# Réseau personnalisé avec sous-réseau dédié -networks: - regisflow-internal: - driver: bridge - internal: false - ipam: - driver: default - config: - - subnet: 192.168.200.0/24 - ip_range: 192.168.200.0/28 - gateway: 192.168.200.1 -``` - -**Avantages** : -- Isolement réseau complet -- Contrôle total des adresses IP -- Sécurité renforcée -- Idéal pour production - -**Utilisation** : -```bash -docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d -``` - -### Option 3 : Configuration Personnalisée +### Configuration Personnalisée (Si Nécessaire) Si vous avez des exigences spécifiques, modifiez le sous-réseau : @@ -128,25 +99,26 @@ ip addr show ## 🎯 Recommandations -### Pour Tests/Développement : -- Utilisez `docker-compose.simple.yml` +### Pour tous les environnements : +- Utilisez `docker-compose.yml` - Aucune configuration réseau nécessaire -- Démarrage rapide +- Démarrage rapide et compatible -### Pour Production : -- Utilisez `docker-compose.yml` -- Vérifiez les conflits avant déploiement -- Personnalisez le sous-réseau si nécessaire +### Si vous avez des besoins spécifiques : +- Modifiez le fichier `docker-compose.yml` +- Ajoutez une configuration réseau personnalisée +- Testez avant déploiement ## 📚 Scripts Inclus -- `install-simple.sh` - Utilise la configuration simple -- `deploy-prod.sh` - Utilise la configuration sécurisée -- `monitoring.sh` - Surveille tous les types de réseaux +- `install-simple.sh` - Installation automatique +- `deploy-prod.sh` - Déploiement production +- `monitoring.sh` - Surveillance des services ## 🔒 Sécurité -Les deux configurations sont sécurisées : +La configuration est sécurisée : - Communications chiffrées entre conteneurs - Isolation des services -- Accès contrôlé aux ports \ No newline at end of file +- Accès contrôlé aux ports +- Réseau Docker par défaut isolé du réseau hôte \ No newline at end of file diff --git a/QUICK_START.md b/QUICK_START.md index 65d0cd6..5cdbef1 100644 --- a/QUICK_START.md +++ b/QUICK_START.md @@ -21,7 +21,7 @@ docker-compose up -d - **Mots de passe** : Pré-configurés dans le fichier `.env` - **Base de données** : PostgreSQL configurée automatiquement -- **Réseau** : Utilise le réseau par défaut Docker (aucun conflit) +- **Réseau** : Utilise le réseau par défaut Docker (aucun conflit IP) - **Volumes** : Gérés automatiquement par Docker - **Migrations** : Exécutées automatiquement au démarrage diff --git a/deploy-prod.sh b/deploy-prod.sh index 7a0e4cc..9386a24 100644 --- a/deploy-prod.sh +++ b/deploy-prod.sh @@ -82,7 +82,7 @@ fi # Démarrer les services avec configuration production echo "🚀 Démarrage des services de production..." -docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d +docker-compose up -d # Attendre le démarrage echo "⏳ Attente du démarrage des services..." diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml deleted file mode 100644 index 6947c1f..0000000 --- a/docker-compose.prod.yml +++ /dev/null @@ -1,107 +0,0 @@ -version: '3.8' - -# Configuration Docker Compose PRODUCTION pour RegisFlow -# Avec optimisations et sécurité renforcée -services: - # Base de données PostgreSQL (Production) - regisflow-db: - image: postgres:15-alpine - container_name: regisflow-db - environment: - POSTGRES_DB: regisflow - POSTGRES_USER: regisflow - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - # Optimisations PostgreSQL pour production - POSTGRES_INITDB_ARGS: "--auth-host=md5 --auth-local=peer" - volumes: - - postgres_data:/var/lib/postgresql/data - - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro - - ./postgres-prod.conf:/etc/postgresql/postgresql.conf:ro - ports: - - "5433:5432" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "pg_isready -U regisflow -d regisflow"] - interval: 30s - timeout: 10s - retries: 5 - start_period: 30s - # Limites de ressources pour production - deploy: - resources: - limits: - memory: 512M - reservations: - memory: 256M - - # Application RegisFlow (Production) - regisflow: - build: - context: . - target: production - container_name: regisflow-app - depends_on: - regisflow-db: - condition: service_healthy - environment: - NODE_ENV: production - PORT: 5000 - DATABASE_URL: postgresql://regisflow:${POSTGRES_PASSWORD}@regisflow-db:5432/regisflow - SESSION_SECRET: ${SESSION_SECRET} - TZ: ${TZ:-Europe/Paris} - # Configuration sécurité production - SECURE_COOKIES: ${SECURE_COOKIES:-true} - DATA_RETENTION_MONTHS: ${DATA_RETENTION_MONTHS:-19} - BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-90} - MAX_BACKUP_COUNT: ${MAX_BACKUP_COUNT:-20} - volumes: - - backup_data:/app/backups - - logs_data:/app/logs - ports: - - "5000:5000" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1"] - interval: 30s - timeout: 15s - retries: 3 - start_period: 90s - # Limites de ressources pour production - deploy: - resources: - limits: - memory: 1G - reservations: - memory: 512M - # Sécurité container - security_opt: - - no-new-privileges:true - read_only: false - tmpfs: - - /tmp - -# Volumes persistants pour production -volumes: - postgres_data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/data/postgres - backup_data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/data/backups - logs_data: - driver: local - driver_opts: - type: none - o: bind - device: ${PWD}/data/logs - -# Réseau par défaut (pas de configuration IP) -networks: - default: - driver: bridge \ No newline at end of file diff --git a/docker-compose.simple.yml b/docker-compose.simple.yml deleted file mode 100644 index 0060c99..0000000 --- a/docker-compose.simple.yml +++ /dev/null @@ -1,68 +0,0 @@ -version: '3.8' - -# Configuration Docker Compose SIMPLE pour RegisFlow -# Installation sans intervention avec réseau automatique -services: - # Base de données PostgreSQL - regisflow-db: - image: postgres:15-alpine - container_name: regisflow-db - environment: - POSTGRES_DB: regisflow - POSTGRES_USER: regisflow - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-RegisFlow2024!PostgreSQL} - volumes: - - postgres_data:/var/lib/postgresql/data - - ./init.sql:/docker-entrypoint-initdb.d/init.sql:ro - ports: - - "5433:5432" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "pg_isready -U regisflow -d regisflow"] - interval: 30s - timeout: 10s - retries: 5 - start_period: 30s - - # Application RegisFlow - regisflow: - build: - context: . - target: production - container_name: regisflow-app - depends_on: - regisflow-db: - condition: service_healthy - environment: - NODE_ENV: production - PORT: 5000 - DATABASE_URL: postgresql://regisflow:${POSTGRES_PASSWORD:-RegisFlow2024!PostgreSQL}@regisflow-db:5432/regisflow - SESSION_SECRET: ${SESSION_SECRET:-RegisFlow2024SessionSecretKey1234567890ABCDEF} - TZ: ${TZ:-Europe/Paris} - SECURE_COOKIES: ${SECURE_COOKIES:-false} - DATA_RETENTION_MONTHS: ${DATA_RETENTION_MONTHS:-19} - BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-90} - MAX_BACKUP_COUNT: ${MAX_BACKUP_COUNT:-20} - volumes: - - backup_data:/app/backups - - logs_data:/app/logs - ports: - - "5000:5000" - restart: unless-stopped - healthcheck: - test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1"] - interval: 30s - timeout: 15s - retries: 3 - start_period: 90s - -# Volumes persistants (création automatique) -volumes: - postgres_data: - backup_data: - logs_data: - -# Réseau par défaut (pas de sous-réseau spécifique) -networks: - default: - driver: bridge \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 3112d6f..a352d1b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.8' -# Configuration Docker Compose SIMPLE pour RegisFlow -# Installation sans configuration réseau complexe +# Configuration Docker Compose pour RegisFlow +# Installation simple sans configuration réseau services: # Base de données PostgreSQL regisflow-db: diff --git a/install-simple.sh b/install-simple.sh index 4cc74cf..87dfee3 100644 --- a/install-simple.sh +++ b/install-simple.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Installation Simple RegisFlow - Aucune configuration requise +# Installation RegisFlow - Configuration automatique # Utilisation: ./install-simple.sh set -e diff --git a/replit.md b/replit.md index 3a50b8d..d48f378 100644 --- a/replit.md +++ b/replit.md @@ -216,6 +216,8 @@ Preferred communication style: Simple, everyday language. - ✅ Simplified network configuration without IP presets to avoid conflicts - ✅ Default Docker bridge network usage for maximum compatibility - ✅ Ultra-simple installation process with single command: docker-compose up -d +- ✅ Single docker-compose.yml file for all environments (dev, test, production) +- ✅ Eliminated multiple configuration files to reduce complexity ### Production Deployment System (January 9, 2025) - ✅ Multi-stage Dockerfile optimized for production with security hardening