Files
LogiFlow/fix-docker-entrypoint.sh
michaelschal f279774f04 Fix Docker entrypoint and apply database migrations for production
Update Dockerfile to correctly copy and execute the entrypoint script, revert CMD to node dist/index.js, and update the SOLUTION_IMMEDIATE.md and add fix-docker-entrypoint.sh to address the 'exec /app/scripts/docker-entrypoint.sh: no such file or directory' error by manually applying database migrations for DLC products.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: f9197b9b-a5b3-4469-a27d-930a9e9ee736
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/f9197b9b-a5b3-4469-a27d-930a9e9ee736/i2gFnxm
2025-08-18 09:42:19 +00:00

40 lines
1.2 KiB
Bash
Executable File

#!/bin/bash
# Script de correction pour Docker entrypoint
# Applique la migration directement via docker-compose exec
set -e
echo "🔧 [FIX] Correction du problème docker-entrypoint.sh"
# Vérifier que le conteneur fonctionne
if ! docker-compose ps | grep -q logiflow; then
echo "❌ [FIX] Conteneur logiflow non trouvé, démarrage..."
docker-compose up -d logiflow-db
sleep 10
fi
echo "🔄 [FIX] Application de la migration DLC directement..."
# Appliquer la migration via exec
docker-compose exec -T logiflow-db psql -U logiflow_admin -d logiflow_db << 'EOF'
-- Migration DLC stock épuisé
ALTER TABLE dlc_products
ADD COLUMN IF NOT EXISTS stock_epuise boolean DEFAULT false NOT NULL,
ADD COLUMN IF NOT EXISTS stock_epuise_by varchar(255),
ADD COLUMN IF NOT EXISTS stock_epuise_at timestamp;
-- Index pour performance
CREATE INDEX IF NOT EXISTS idx_dlc_products_stock_epuise ON dlc_products(stock_epuise);
-- Vérification
SELECT 'Migration DLC appliquée' as status;
EOF
echo "✅ [FIX] Migration DLC appliquée avec succès"
# Redémarrer le conteneur application
echo "🔄 [FIX] Redémarrage du conteneur application..."
docker-compose restart logiflow
echo "✅ [FIX] Correction terminée"