Fix db host-port collision: separate DB_HOST_PORT from the internal port
DB_PORT was doing double duty - the container-internal port baked into
DATABASE_URL (must be 3306) and the host-published port in
docker-compose.yml. Setting it to 3306 for the URL made compose try to
publish host :3306, which collides with another stack's MySQL.
DATABASE_URL now hardcodes database:3306 (always correct inside the
compose network); the host publish uses ${DB_HOST_PORT:-3310}.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ services:
|
||||
- --character-set-server=utf8mb4
|
||||
- --collation-server=utf8mb4_unicode_ci
|
||||
ports:
|
||||
- "127.0.0.1:${DB_PORT:-3310}:3306"
|
||||
- "127.0.0.1:${DB_HOST_PORT:-3310}:3306"
|
||||
volumes:
|
||||
- database_data:/var/lib/mysql
|
||||
healthcheck:
|
||||
|
||||
Reference in New Issue
Block a user