Docker and CI/CD · Junior · Question 25 of 75
Does depends_on: [db] wait until the database is ready to accept connections?
- ✓Correct answer: Not by default; it only orders startup
- 2Yes, it waits until the database logs it's ready
- 3Yes, Compose always waits for a TCP port
Explanation
By default it waits only for the container to start. Use condition: service_healthy with a healthcheck on db, and make the app retry connections anyway.