Docker Compose networking
How to easily network your containers with Docker Compose.
Communication is key
Last time we learned how to run multiple containers with Docker Compose, but we didn’t quite get our containers to communicate with each other. This time we will do just that.
Here’s the previous post of this series:
If you are following and reproducing the examples I provide, at this point please have the containers up and running, as described in the ‘Simple Docker container orchestration with Docker Compose’ part of this series.
How to connect from one container to another?
Previously we got PostgreSQL database system running, along with its admin tool PGAdmin4. What we did not yet achieve was connect the two together. Obviously you first need to add the database server to PGAdmin4 to be able administrate it. With PGAdmin4 in our web browser, click Add New Server to start the process of connecting to the database.