mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-20 21:48:40 +02:00
Improve database migration and application startup processes
Update Dockerfile to generate database migrations, compile a migration script, and adjust the CMD for application startup. Modify docker-compose.yml to comment out PostgreSQL port exposure for security and update the command to run the new migration script. Add dependencies and a new migration script (server/migrate.ts) to handle database schema changes. Update INSTALLATION.md to reflect changes in database access and security recommendations. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/ds3R7vP
This commit is contained in:
1 parent
33ffb9a8ed
commit
306a038afb
7 files changed
+177
-112
No files matched your search
+5
-3
@@ -12,8 +12,10 @@ services:
|
||||
POSTGRES_PASSWORD: ${PGPASSWORD:-changeme}
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
ports:
|
||||
- "${PGPORT:-5432}:5432"
|
||||
# Port non exposé sur l'hôte pour plus de sécurité en production
|
||||
# Décommentez la ligne suivante si vous avez besoin d'accéder à la DB localement
|
||||
# ports:
|
||||
# - "${PGPORT:-5432}:5432"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${PGUSER:-socialflow}"]
|
||||
interval: 10s
|
||||
@@ -41,7 +43,7 @@ services:
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
command: sh -c "npm run db:push && node dist/server.js"
|
||||
command: sh -c "node dist/migrate.js && npm run start"
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
Reference in new issue
Block a user