From 0252abc41c86ef91fd5f4a487fa7a8c3822a7499 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 21:12:07 +0000 Subject: [PATCH] Simplify application startup and improve deployment process Refactors Docker setup to build the app, removes tsx, and streamlines entrypoint. 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 --- Dockerfile | 4 ++-- README_DOCKER.md | 2 +- deploy.sh | 7 ++++--- docker-entrypoint.sh | 8 ++++++-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index b6ad9d6..5ac5def 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,5 +40,5 @@ ENV PORT=5000 # Utiliser dumb-init pour gérer les signaux ENTRYPOINT ["dumb-init", "--"] -# Démarrer l'application avec tsx pour éviter les problèmes de build -CMD ["docker-entrypoint.sh", "npx", "tsx", "server/index.ts"] \ No newline at end of file +# Démarrer avec le script d'entrée +CMD ["docker-entrypoint.sh"] \ No newline at end of file diff --git a/README_DOCKER.md b/README_DOCKER.md index b5da8dc..eba188e 100644 --- a/README_DOCKER.md +++ b/README_DOCKER.md @@ -75,7 +75,7 @@ host regisflow regisflow 0.0.0.0/0 md5 sudo systemctl restart postgresql ``` -**SEULE MODIFICATION NÉCESSAIRE** : Remplacer `VOTRE_IP_POSTGRES` par l'IP réelle de votre serveur. +**AUCUNE MODIFICATION NÉCESSAIRE** : Tout est préconfigué pour fonctionner immédiatement. ### 3. Lancer l'application diff --git a/deploy.sh b/deploy.sh index 00a0b5f..d924422 100644 --- a/deploy.sh +++ b/deploy.sh @@ -28,10 +28,11 @@ docker system prune -f if [ ! -f .env ]; then echo "📝 Création du fichier .env..." cp .env.example .env - echo "⚠️ IMPORTANT: Configurez l'IP de votre serveur PostgreSQL :" - echo " - Remplacez 192.168.1.100 par l'IP de votre serveur PostgreSQL" + echo "⚠️ Configuration PostgreSQL Docker :" + echo " - PostgreSQL et RegisFlow seront créés dans Docker" echo " - Utilisateur/mot de passe préconfigurés : regisflow / RegisFlow2024!" - echo " - Exécutez setup-postgres.sql sur votre serveur PostgreSQL" + echo " - Port PostgreSQL externe : 5433" + echo " - Port RegisFlow : 5000" echo " - Changez SESSION_SECRET pour la sécurité" read -p "Appuyez sur Entrée pour continuer..." fi diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 0993a55..b25f3cd 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -37,6 +37,10 @@ npx drizzle-kit push # Créer le répertoire des sauvegardes s'il n'existe pas mkdir -p /app/backups -# Démarrer l'application +# Construire l'application pour la production +echo "🔨 Construction de l'application..." +npm run build + +# Démarrer l'application en production echo "🎯 Démarrage de l'application RegisFlow..." -exec "$@" \ No newline at end of file +exec npm run start \ No newline at end of file