Fix DB port and test access#35
Merged
Merged
Conversation
…by moving db_prod to 5435, keeps db_test on 5434, and adds FLASK_ENV=test handling in sqlalchemy_setup_database.py to switch cleanly between prod (DATABASE_URL) and test (TEST_DATABASE_URL) connections
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Correction du conflit de port PostgreSQL et amélioration du workflow de développement
Problème
La machine hôte a un PostgreSQL 16 natif installé sur le port 5433, qui entre en conflit avec le mapping de port du conteneur Docker
db_prod(5433:5432). Le mapping Docker échoue silencieusement → l'application se connecte au PostgreSQL natif (qui a des identifiants différents) au lieu du conteneur Docker →password authentication failed.Modifications
docker-compose.yml — Passage du port
db_prodde5433à5435pour éliminer le conflit avec le PostgreSQL natif. Aucune perte de données (volumepgdata_prodinchangé).sqlalchemy_setup_database.py — Ajout du support
FLASK_ENV=test. QuandFLASK_ENV=testest défini, l'application se connecte àTEST_DATABASE_URL(BDD test sur le port 5434) au lieu deDATABASE_URL(BDD prod sur le port 5435). Permet un développement local sûr sans toucher aux données de production.Utilisation