I’m setting up two containers: mariadb + phpMyAdmin. I’d like to reach mariadb instance via PMA login. I don’t want to type mariadb container ip, but it’s name or alias. How can I do that, avoiding direct linking to that?
version: '3' services: pma: image: phpmyadmin/phpmyadmin container_name: pma ports: - '80:80' environment: - PMA_ARBITRARY=1 restart: always network_mode: bridge mariadb: image: mariadb container_name: mariadb ports: - '3306:3306' environment: - MYSQL_ROOT_PASSWORD=toor volumes: - '.database:/var/lib/mysql' restart: always network_mode: bridge
I’ve tried setting up a custom bridge network and it seems to work, but I don’t really need nothing else than the default bridge network.
In the above configuration, phpMyAdmin instance is not pinging “mariadb” host…