A Docker network connects containers so application components can communicate. In a web-service deployment, a shared network links the tutor service and its Postgres database. section 12.3.1 section 12.5
Connect the tutor service and database
Create `tutor-network`, connect `tutor-webservice` and `tutor-postgres`, then inspect the network. The deployment uses `tutor-postgres` as the database host in `DATABASE_URL`. section 12.3.1 section 12.5
"Containers": {
"26a5fc9ac00d815cb933bf66755d1fd04f6dca1efe1ffbc96f28da50e65238ba": {
"Name": "tutor-postgres",
"EndpointID":
"e870c365731463198fbdf46ea4a7d22b3f9f497727b410852b86fe1567c8a3e6",
"MacAddress": "02:42:ac:1b:00:03",
"IPv4Address": "172.27.0.3/16",
"IPv6Address": ""
},
"af6e823821b36d13bf1b381b2b427efc6f5048386b4132925ebd1ea3ecfa5eaa": {
"Name": "tutor-webservice",
"EndpointID":
"015e1dbc36ae8e454dc4377ad9168b6a01cae978eac4e0ec8e14be98d08b4f1c",
"MacAddress": "02:42:ac:1b:00:02",
"IPv4Address": "172.27.0.2/16",
"IPv6Address": ""
}
},
Inspect output lists both containers attached to the network and their assigned IP addresses. section 12.5
