0

I have multiple DDEV Containers, and want to change the Ports for each phpMyAdmin process for the Container to connecting to the correct Database.

How can I do this?

I know the Defaultport is 8036, but I need different Ports.

Edit

I found the position of the port, but it looks global.

In my ~/.ddev folder inside the file router-compose.yaml i found this

services:
  ddev-router:
    image: drud/ddev-router:v0.5.0
    container_name: ddev-router
    ports:
      - "80:80"
      - "8025:8025"
      - "443:443"
      - "8036:8036"

In the last line is the Port of phpMyAdmin. I think I can add here more Ports, but if that works, how to "bind" it to the unique Container?

Edit 2

I found this Note in the Documentation

Note: The host database port is likely to change any time a project is stopped/removed and then later started again.

Is it even possible to change the phpMyAdmin-Port to a static port?

MonTea
  • 1,166
  • 1
  • 13
  • 30
  • 1
    So every project already has its own phpmyadmin process, they're selected by the hostname. So if you have project1.ddev.local and project2.ddev.local, the phpmyadmin instances reached by http://project1.ddev.local:8036 and http://project2.ddev.local:8036 are different instances, and they show the db for each separate project. – rfay May 24 '18 at 12:47
  • Each *running* phpmyadmin container has an ephemeral port on localhost as well, so if you `docker ps | grep ddev-project1-dba` you'll see a mapping like `0.0.0.0:32831->80/tcp`; you can use that port to access phpmyadmin for project1 directly, like in this case, http://localhost:32831 – rfay May 24 '18 at 12:50
  • If you just have an unresolve-able conflict on port 8036 in general, that would be a good feature request. The router-compose.yaml is regenerated all the time and can't be edited. – rfay May 24 '18 at 12:54
  • I thought I got a problem, after ddev stop the phpmyadmin doesn't disappear in the browser after a hard-refresh, but after a second view with the same url another db-content from another container has appears with the wrong url/container. So I thought it could be nice to get a different port for each project-phpMyAdmin. But now I think its a wrong configuration. – MonTea May 24 '18 at 14:51
  • Thanks for the folowup! – rfay May 25 '18 at 15:22

0 Answers0