Complete the code to specify that service2 should start after service1.
services:
service1:
image: alpine
service2:
image: alpine
depends_on:
- [1]The depends_on key lists services that must start before the current one. Here, service2 depends on service1.
Complete the code to make serviceB start only after serviceA is ready.
services:
serviceA:
image: nginx
serviceB:
image: nginx
depends_on:
- [1]Using depends_on with serviceA ensures serviceB waits for serviceA to start.
Fix the error in the depends_on section to correctly order serviceX after serviceY.
services:
serviceX:
image: redis
depends_on:
- [1]The depends_on must list the service that serviceX depends on, which is serviceY.
Fill both blanks to make serviceAlpha start after serviceBeta and serviceGamma.
services:
serviceAlpha:
image: ubuntu
depends_on:
- [1]
- [2]Listing both serviceBeta and serviceGamma under depends_on ensures serviceAlpha starts after both.
Fill all three blanks to make serviceOne start after serviceTwo and serviceThree, and serviceTwo start after serviceFour.
services:
serviceOne:
image: alpine
depends_on:
- [1]
- [2]
serviceTwo:
image: alpine
depends_on:
- [3]serviceOne depends on serviceTwo and serviceThree. serviceTwo depends on serviceFour. This sets the correct start order.