I am not sure if this is a bug, or a feature. But I have been running this docker-compose setup for my local development databases several months now and since I have updated Docker and Lando it stopped working.
As you can see I use it for some php sites managed with Lando. Since the last update either the ports
or the network
directive is not working on the MySQL container.
- If I use it with the snippet below the
ports
directive is not working. Meaning I can not connect from QueryPie onlocalhost:3306
, but can connect from another lando docker container withmysql_db
as host. - If I comment out the
networks
directive, theports
directive is working. But thenetworks
directive obviously not. Meaning I can connect from QueryPie onlocalhost:3306
, but I can not connect from another lando docker container withmysql_db
as host.
Before the update they worked nice together. So I could open MySQL in QueryPie and access the databases from the Lando containers.
version: '3'
services:
mysql:
container_name: mysql_db
restart: always
image: mysql:latest
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=secret
volumes:
- ./mysql-data:/var/lib/mysql
networks:
- lando_bridge_network
networks:
lando_bridge_network:
external: true
My docker engine is 19.03.8 and my docker-compose version is 1.25.5.