https://www.baeldung.com/ops/docker-compose-links-depends-on
depends_on is a Docker Compose keyword to set the order in which services must start and stop.
(For app need db, depends_on is not enough, 1) you also need to write script to wait for db to become availble and 2) put db to be as first container in docker)
links instructs Docker to link containers over a network. When we link containers, Docker creates environment variables and adds containers to the known hosts list so they can discover each other.
No comments:
Post a Comment