mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-11 17:27:31 +02:00
Prepare system for database migrations and French localization improvements
Update Dockerfile to include migration scripts, configure PostgreSQL credentials in docker-compose.yml, and enhance the auto-migration script to support full database migration with French localization. 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/JKfj3tT
This commit is contained in:
1 parent
785105814a
commit
98d1e62200
3 files changed
+20
-4
No files matched your search
+2
-1
@@ -81,8 +81,9 @@ RUN npm ci --only=production && npm cache clean --force
|
||||
COPY --from=build --chown=nextjs:nodejs /app/dist ./dist
|
||||
COPY --from=build --chown=nextjs:nodejs /app/shared ./shared
|
||||
|
||||
# Copy migration scripts
|
||||
# Copy migration scripts and files
|
||||
COPY --chown=nextjs:nodejs scripts/ ./scripts/
|
||||
COPY --chown=nextjs:nodejs migrations/ ./migrations/
|
||||
|
||||
# Create symlink for public files to be accessible from dist
|
||||
RUN ln -sf /app/dist/public /app/dist/public
|
||||
|
||||
@@ -13,6 +13,9 @@ services:
|
||||
SESSION_SECRET: LogiFlow_Super_Secret_Session_Key_2025_Production
|
||||
PORT: 3000
|
||||
USE_LOCAL_AUTH: "true"
|
||||
POSTGRES_USER: logiflow_admin
|
||||
POSTGRES_PASSWORD: LogiFlow2025!
|
||||
POSTGRES_DB: logiflow_db
|
||||
ports:
|
||||
- "3000:3000"
|
||||
networks:
|
||||
|
||||
Regular → Executable
+15
-3
@@ -1,12 +1,24 @@
|
||||
#!/bin/bash
|
||||
# Script de migration automatique - Crée UNIQUEMENT la table announcements
|
||||
# Toutes les autres tables existent déjà en production
|
||||
# Script de migration automatique - Production
|
||||
# Crée la table announcements et ajoute les champs DLC stock épuisé
|
||||
|
||||
set -e
|
||||
|
||||
echo "🔄 [AUTO-MIGRATE] Vérification de la table announcements..."
|
||||
echo "🔄 [AUTO-MIGRATE] Début des migrations automatiques..."
|
||||
|
||||
# Construire DATABASE_URL si nécessaire
|
||||
if [ -z "$DATABASE_URL" ]; then
|
||||
if [ -n "$POSTGRES_USER" ] && [ -n "$POSTGRES_PASSWORD" ] && [ -n "$POSTGRES_DB" ]; then
|
||||
export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@logiflow-db:5432/${POSTGRES_DB}"
|
||||
echo "🔧 [AUTO-MIGRATE] URL de base de données construite"
|
||||
else
|
||||
echo "❌ [AUTO-MIGRATE] Variables de base de données manquantes"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Vérifier si la base de données est accessible
|
||||
echo "🔗 [AUTO-MIGRATE] Test de connexion à la base de données..."
|
||||
if ! psql "$DATABASE_URL" -c "SELECT 1;" > /dev/null 2>&1; then
|
||||
echo "❌ [AUTO-MIGRATE] Impossible de se connecter à la base de données"
|
||||
exit 1
|
||||
|
||||
Reference in new issue
Block a user