WordPress.org

Make WordPress Core

Opened 5 weeks ago

Last modified 5 weeks ago

#48281 new enhancement

Expose port 3306 of MySQL container

Reported by: ocean90 Owned by:
Milestone: 5.4 Priority: normal
Severity: normal Version:
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:
PR Number:

Description

To allow accessing the container from external the port 3306 should get exposed. This is done by defining ports in the config, see https://docs.docker.com/compose/compose-file/#ports.

To retrieve the host port you can then use docker-compose port mysql 3306.

Attachments (2)

48281.diff (312 bytes) - added by ocean90 5 weeks ago.
48281.2.diff (312 bytes) - added by peterwilsoncc 5 weeks ago.

Download all attachments as: .zip

Change History (4)

@ocean90
5 weeks ago

#1 follow-up: @peterwilsoncc
5 weeks ago

48281.2.diff accounts for users that may be exposing a database on the default port:

  • sets default to a non-standard value, 8836
  • allows users to change the port using an environment variable, similar to the local port for the web server

#2 in reply to: ↑ 1 @ocean90
5 weeks ago

Replying to peterwilsoncc:

48281.2.diff accounts for users that may be exposing a database on the default port:

That’s why my patch only defines the container port to allow docker-compose to choose an ephemeral host port.

Note: See TracTickets for help on using tickets.