fix(deploy): utiliser le nom MySQL unique sur le réseau web

This commit is contained in:
Manus Automation
2026-08-18 09:22:38 +00:00
parent 55e91cdfc9
commit 6f73a3951e

View File

@@ -13,12 +13,10 @@ services:
MYSQL_DATABASE: facturation_santinova MYSQL_DATABASE: facturation_santinova
MYSQL_CHARACTER_SET_SERVER: utf8mb4 MYSQL_CHARACTER_SET_SERVER: utf8mb4
MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci MYSQL_COLLATION_SERVER: utf8mb4_unicode_ci
ports:
- "${DB_PORT:-3306}:3306"
volumes: volumes:
- mysql_data:/var/lib/mysql - mysql_data:/var/lib/mysql
networks: networks:
- santinova-network - web
healthcheck: healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD:-santinova_db_pass}"] test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${DB_ROOT_PASSWORD:-santinova_db_pass}"]
interval: 10s interval: 10s
@@ -41,7 +39,8 @@ services:
environment: environment:
NODE_ENV: production NODE_ENV: production
PORT: 3001 PORT: 3001
DATABASE_URL: mysql://root:${DB_ROOT_PASSWORD:-santinova_db_pass}@db:3306/facturation_santinova # Le réseau web est partagé par plusieurs projets : ne jamais utiliser lalias générique `db`.
DATABASE_URL: mysql://root:${DB_ROOT_PASSWORD:-santinova_db_pass}@santinova-facturation-db:3306/facturation_santinova
JWT_SECRET: ${JWT_SECRET:-santinova-jwt-secret-change-in-production} JWT_SECRET: ${JWT_SECRET:-santinova-jwt-secret-change-in-production}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-24h} JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-24h}
UPLOAD_DIR: /app/uploads UPLOAD_DIR: /app/uploads
@@ -51,7 +50,7 @@ services:
volumes: volumes:
- uploads_data:/app/uploads - uploads_data:/app/uploads
networks: networks:
- santinova-network - web
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"] test: ["CMD", "curl", "-f", "http://localhost:3001/api/health"]
interval: 30s interval: 30s
@@ -71,9 +70,9 @@ services:
db: db:
condition: service_healthy condition: service_healthy
environment: environment:
DATABASE_URL: mysql://root:${DB_ROOT_PASSWORD:-santinova_db_pass}@db:3306/facturation_santinova DATABASE_URL: mysql://root:${DB_ROOT_PASSWORD:-santinova_db_pass}@santinova-facturation-db:3306/facturation_santinova
networks: networks:
- santinova-network - web
restart: "no" restart: "no"
volumes: volumes:
@@ -83,5 +82,5 @@ volumes:
driver: local driver: local
networks: networks:
santinova-network: web:
driver: bridge external: true