Docker Compose
Posted on June 2, 2022
Tags: devops
1 Network
- Imagine a scenario when you want your backend container to connect to your DB container
- BAD: Expose the backend container port, and the DB container port to the outside world then attempt to used each of their respective exposed port to talk.
- GOOD: docker-compose has a default DNS server that gives containers their domain name based on the label we used their docker-compose file.
- Example
myAwesomeDB:5432
translates into192.168.4.4:5432
with docker-compose.yml
- Example
~