-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
env: Expose port 3306 of mysql container #21545
Conversation
This only defines the container port to allow docker to choose an ephemeral host port.
Size Change: 0 B Total Size: 903 kB ℹ️ View Unchanged
|
Howdy @ocean90 thanks for this PR! I wonder could we make it so that the port on the host can be custom like the one for the http server? Folks have all kinds of things running on host ports and this ability would be nice. Also what is the best way to test this PR works if you have |
You can run wp-env directly from gutenberg if this branch is checked out. (there should be no need to build the code if your node version is up to date) ../path/to/gutenberg/packages/env/bin/wp-env $command |
As implemented this PR makes Docker expose the private port ( I think this is a good compromise as it allows very advanced use-cases without adding any extra configuration or complexity to @ocean90: Out of curiosity, what is your use-case for wanting this? |
Thanks for the feedback! As mentioned before it's not that common to connect to the database directly but if it's necessary it should be still possible. So that's why there's no config for that. Use cases are for example validating the data in the database, using the database for PHPUnit plugin tests or just quickly importing an existing database dump. |
Another usecase is for when you want to inspect the DB using a client such as SequelPro @noisysocks However I find that |
Maybe e.g.
At any rate, I see no reason we can't merge this PR as is for now. |
Follow up for @noisysocks's comment about logs |
This only defines the container port to allow docker to choose an ephemeral host port.
Fixes #21544.
Testing Instructions:
docker-compose.yml
and verify thatdocker-compose port mysql 3306
to get the port number.