Docker Community Forums

Share and learn in the Docker community.

Extra mysql port opening on one computer only

I have a docker-compose container using a custom-built Wordpress image and the standard mysql image. here’s the compose file:

services:
   mysql:
     image: mysql:5.7
     volumes:
       - dbdata:/var/lib/mysql
       - ./mysql/mydb.sql:/docker-entrypoint-initdb.d/mydb.sql
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD_FILE: filelocation
       MYSQL_DATABASE: mydb
       MYSQL_USER: mysqluser
       MYSQL_PASSWORD_FILE: filelocation
       MYSQL_ROOT_HOST: '%'
     secrets:
      - mysql_root_password
      - mysql_password
   wordpress:
     depends_on:
       - mysql
     image: myimageurl:latest
     ports:
       - "8000:80"
     restart: always
     volumes:
       - type: bind
         source: ./wordpress/themes/mytheme
         target: /var/www/wordpress/wp-content/themes/mytheme
       - type: bind
         source: ./wordpress/tests
         target: /var/www/wordpress/tests
       - type: bind
         source: ./wordpress/plugins
         target: /var/www/wordpress/wp-content/plugins
     environment:
       WORDPRESS_DB_HOST: mysql
       WORDPRESS_DB_PORT: 3306
       WORDPRESS_DB_USER: wordpress
       MYSQL_ROOT_HOST: '%'

This setup has been working flawlessly for me for about 2 years. I do docker-compose up and it just works, with the Wordpress site at localhost:8000.

However we recently brought on a new developer and this setup doesn’t work at all on his machine. It’s a brand new Macbook. We bring up the app with docker-compose up, and the output looks exactly the same, but attempting to bring up localhost:8000 just redirects to “localhost” (no port specified) and displays an error page. This happens in every browser.

The only difference we were able to find is that docker ps shows an extra port for mySQL.

Mine show 3306/tcp under PORTS for mysql, his shows 33060/tcp, 0.0.0.0:32769->3306/tcp for it, even though nothing is different with his Dockerfile or docker-compose. Help!

thanks

This rather has to do with the Wordpress configuration than with MySQL. If you start a simple web server (image httpd) instead of Wordpress, can you access port 8000?