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:
michaelschal committed 2025-10-01 10:01:59 +00:00
1 parent 33ffb9a8ed
commit 306a038afb
7 files changed
+177 -112

No files matched your search

+15 -1
View File
@@ -149,12 +149,26 @@ server {
2. Configurez un reverse proxy avec cache
3. Utilisez un stockage SSD pour les volumes
## Accès à la base de données PostgreSQL
Par défaut, le port PostgreSQL n'est **pas exposé** sur l'hôte pour des raisons de sécurité. Si vous avez besoin d'accéder à la base de données depuis votre machine locale (pour administration, backup, etc.), décommentez les lignes suivantes dans `docker-compose.yml` :
```yaml
# À décommenter si vous avez besoin d'accéder à la DB localement
ports:
- "${PGPORT:-5432}:5432"
```
**Attention :** N'exposez jamais le port PostgreSQL en production sur un serveur accessible depuis Internet.
## Sécurité
- Changez toujours `PGPASSWORD` et `SESSION_SECRET`
- Changez toujours `PGPASSWORD` et `SESSION_SECRET` avant le déploiement
- Utilisez HTTPS en production (avec Let's Encrypt par exemple)
- Configurez un firewall pour limiter l'accès aux ports
- N'exposez pas le port PostgreSQL (5432) sur Internet en production
- Mettez à jour régulièrement les images Docker
- Sauvegardez régulièrement votre base de données
## Support