mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
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
This commit is contained in:
1 parent
b2acb20aa6
commit
9997fa38f5
9 files changed
+27
-228
No files matched your search
+1
-1
@@ -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
|
||||
```
|
||||
|
||||
+19
-47
@@ -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
|
||||
- Accès contrôlé aux ports
|
||||
- Réseau Docker par défaut isolé du réseau hôte
|
||||
+1
-1
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -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..."
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
+2
-2
@@ -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:
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Installation Simple RegisFlow - Aucune configuration requise
|
||||
# Installation RegisFlow - Configuration automatique
|
||||
# Utilisation: ./install-simple.sh
|
||||
|
||||
set -e
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user