When depends_on is being used in docker-compose.yml?
When a web app has connection to a database, in the docker compose yml file, I see these two examples. One is with depends_on and one is without depends_on.
In one tutorial, I see that there is no depends_on is being used.
version: '3'
services:
ms-sql-server:
image: mcr.microsoft.com/mssql/server:2017-latest-ubuntu
environment:
ACCEPT_EULA: "Y"
SA_PASSWORD: "xxxx"
ports:
- "1433:1433"
book-app:
build: .
ports:
- "8090:80"
In another example, I see that depends_on is being used.
version: "3"
services:
api:
build:
context: ..
dockerfile: CF.Api/Dockerfile
ports:
- "8888:80"
depends_on:
- db
db:
image: "mcr.microsoft.com/mssql/server"
environment:
SA_PASSWORD: "xxxx"
ACCEPT_EULA: "Y"
