From dccf01e9c85c529f233bc83efe77b9ba73a7e093 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 20:52:33 +0000 Subject: [PATCH] Clarify database connection settings and access instructions for Docker Update .env instructions and debugging scripts to reflect the internal Docker network database port. 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/6e755801-08e8-4492-805e-ac3610de5a2a.jpg --- .env.example | 9 +++++++-- debug-docker.sh | 3 +++ deploy.sh | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) mode change 100755 => 100644 debug-docker.sh mode change 100755 => 100644 deploy.sh diff --git a/.env.example b/.env.example index f87cbbd..6c734f9 100644 --- a/.env.example +++ b/.env.example @@ -2,11 +2,16 @@ # Copiez ce fichier en .env et modifiez les valeurs selon vos besoins # Configuration de la base de données +# IMPORTANT: Pour Docker, utilisez 'postgres:5432' (réseau interne Docker) DATABASE_URL=postgresql://regisflow:regisflow2024@postgres:5432/regisflow POSTGRES_PASSWORD=regisflow2024 -# Note: En cas de conflit de port, PostgreSQL sera accessible sur le port 5433 depuis l'hôte -# mais l'application utilise le port 5432 interne au réseau Docker +# Explication des ports : +# - Port 5432 : Communication interne entre containers Docker (RegisFlow → PostgreSQL) +# - Port 5433 : Accès externe depuis votre machine (Machine hôte → PostgreSQL) +# +# L'application RegisFlow utilise TOUJOURS postgres:5432 en interne +# Vous accédez à PostgreSQL depuis votre machine via localhost:5433 # Configuration de l'application NODE_ENV=production diff --git a/debug-docker.sh b/debug-docker.sh old mode 100755 new mode 100644 index 456854e..b214de9 --- a/debug-docker.sh +++ b/debug-docker.sh @@ -25,7 +25,10 @@ docker-compose exec regisflow env | grep -E "(DATABASE_URL|POSTGRES|NODE_ENV)" echo "" echo "6. Test manuel de connexion PostgreSQL:" +echo " - Test depuis le container postgres:" docker-compose exec postgres pg_isready -U regisflow -d regisflow +echo " - Test depuis le container regisflow vers postgres:5432:" +docker-compose exec regisflow pg_isready -h postgres -p 5432 -U regisflow echo "" echo "7. Processus dans le container PostgreSQL:" diff --git a/deploy.sh b/deploy.sh old mode 100755 new mode 100644 index 3182759..912a229 --- a/deploy.sh +++ b/deploy.sh @@ -28,8 +28,10 @@ docker system prune -f if [ ! -f .env ]; then echo "📝 Création du fichier .env..." cp .env.example .env - echo "⚠️ IMPORTANT: Éditez le fichier .env avec vos paramètres avant de continuer" - echo " Notamment: POSTGRES_PASSWORD et SESSION_SECRET" + echo "⚠️ IMPORTANT: Vérifiez le fichier .env :" + echo " - DATABASE_URL doit utiliser 'postgres:5432' (réseau Docker interne)" + echo " - Changez POSTGRES_PASSWORD et SESSION_SECRET pour la sécurité" + echo " - L'accès externe à PostgreSQL se fait via localhost:5433" read -p "Appuyez sur Entrée pour continuer..." fi