Skip to content

Expose port 3306 only to the global default DB#100

Merged
peterjaap merged 1 commit into
qoliber:mainfrom
roelofelgentos:fix-default-db-standard-port
Apr 24, 2026
Merged

Expose port 3306 only to the global default DB#100
peterjaap merged 1 commit into
qoliber:mainfrom
roelofelgentos:fix-default-db-standard-port

Conversation

@roelofelgentos
Copy link
Copy Markdown
Contributor

Summary

  • Bind the standard MySQL port (3306) strictly to the version named by globalCfg.DefaultServices.MySQL (or MariaDB when no MySQL is configured), instead of also exposing it whenever a single DB service is in play.
  • Prevents a Bind for 0.0.0.0:3306 failed: port is already allocated error when one project is using e.g. MySQL 5.7 while a default-version container (MySQL 8.0) is still running from another project.

Test plan

  • make lint
  • make test
  • With DefaultServices.MySQL = 8.0, start a project using MySQL 5.7 while magebox-mysql-8.0 is running — 5.7 comes up on 33057 only; 8.0 keeps 3306.
  • With only one project running on MySQL 8.0 (matching the default), confirm it still binds both 33080 and 3306.
  • With a project running MariaDB 10.6 (matching DefaultServices.MariaDB) and no MySQL configured, confirm it binds 3306.

Previously a single MySQL/MariaDB service in play would also grab port
3306, which conflicted with an existing default-version container left
running from another project. Bind 3306 strictly to the version named
by globalCfg.DefaultServices.MySQL (or MariaDB when no MySQL is
configured), so only one container ever claims the standard port.
@peterjaap peterjaap merged commit c833e20 into qoliber:main Apr 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants