1

I am trying to communicate between 2 different docker networks, but they cannot seem to be reached by each other.

I have one Docker network that is for a group mail server container I have another Docker network that is for some websites, so a container running nginx, a container running php-fpm, and a container running mariadb.

I am trying to connect to the mail server container in a PHP script (from php-fpm container) to send an email, using the domain pointing to the mail server's external IP (smtp.example.com). This mail server is running fine and can be reached and used from external nodes, it's just when trying to reach it from a container on a different Docker network.

How can I access the mail server network from a different docker network? I don't want to consolidate the two networks into one.

Lin Du
  • 88,126
  • 95
  • 281
  • 483
greyto
  • 11
  • 1
  • Does this answer your question? [Communicating between Docker containers in different networks on the same host](https://stackoverflow.com/questions/36035595/communicating-between-docker-containers-in-different-networks-on-the-same-host) – aiqency Apr 09 '20 at 06:51

0 Answers0