Skip to content
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

Support exposing database port to local client #222

Closed
paulholden opened this issue Jul 27, 2022 · 3 comments
Closed

Support exposing database port to local client #222

paulholden opened this issue Jul 27, 2022 · 3 comments

Comments

@paulholden
Copy link
Member

Something that can automate the following in a cross-DB compatible manner:

$ git diff
diff --git a/db.mysql.yml b/db.mysql.yml
index 368785f..ccb28af 100644
--- a/db.mysql.yml
+++ b/db.mysql.yml
@@ -17,3 +17,5 @@ services:
       MYSQL_USER: moodle
       MYSQL_PASSWORD: "m@0dl3ing"
       MYSQL_DATABASE: moodle
+    ports:
+      - 127.0.0.1:33066:3306

Which would allow a client to connect to the running database from the host

@scara
Copy link
Contributor

scara commented Jul 27, 2022

Hi @paulholden,
I'd suggest an approach like the one used for the web port:

ports:
- "${MOODLE_DOCKER_WEB_PORT}:80"

This will help people like me whose Docker Engine is not in the same machine but in another host i.e. 1.2.3.4: and not 127.0.0.1:.

HTH,
Matteo

@skodak
Copy link
Contributor

skodak commented Sep 27, 2022

see #226

@stronk7
Copy link
Member

stronk7 commented Oct 4, 2022

Closing this coz #226 implements it and has landed.

Ciao :-)

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

No branches or pull requests

4 participants