Depends_on: is not working

I’ve used below code in docker-compose.yml (yml file is well formed) , but I am getting incorrect error for the question ‘wordpress is linked to DB container?’ in quiz portal. can anyone pls look this ?

version: 2
services:
db:
image: postgres
environment:
- POSTGRES_PASSWORD=mysecretpassword
wordpress:
image: wordpress
ports:
- 8085:80
depends_on:
- db

Kindly check the full solution below:

Wordpress

Hi,
you didn’t use depends_on in your solution, you just used links:
my query is why depends_on is not working ?

thanks
anil kumar

Hello, anil.bmam
Task is about to link wordpress container to db container so used links field. In the case of depends_on, wordpress container will not start before db container. First db container will up then wordpress container. There is no issue with it but primary focus on links field at the moment.