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:
Frank
2026-09-06 21:07:51 +02:00
co-authored by Claude Sonnet 5
parent ade11494be
commit 25b68cb1df
4 changed files with 13 additions and 12 deletions
+2 -2
View File
@@ -26,7 +26,7 @@ MariaDB/MySQL (WAMP is fine). `.php-version` pins this directory to PHP 8.5.
cp .env .env.local
# then edit .env.local:
# APP_ENV=dev
# DATABASE_URL="mysql://root:@127.0.0.1:3306/dmtools?serverVersion=10.10.2-MariaDB&charset=utf8mb4"
# DATABASE_URL="mysql://root:@127.0.0.1:3307/dmtools?serverVersion=10.10.2-MariaDB&charset=utf8mb4"
# 2. Install and build
symfony composer install
@@ -51,7 +51,7 @@ Docker only. `docker/setup.sh` pins the compose project name to `dmtools`
git pull
cp .env .env.local # first time only
# edit .env.local: real APP_SECRET (or let setup.sh generate it),
# DB_PASSWORD, DB_ROOT_PASSWORD, and NGINX_PORT / DB_PORT if 8085 / 3310 clash
# DB_PASSWORD, DB_ROOT_PASSWORD, and NGINX_PORT / DB_HOST_PORT if 8085 / 3310 clash
./docker/setup.sh
docker compose -p dmtools exec php php bin/console app:user:create you@example.com --admin
```