compose-depends-on.yaml 582 B

123456789101112131415161718192021222324252627
  1. services:
  2. with-restart:
  3. image: nginx:alpine
  4. init: true
  5. command: tail -f /dev/null
  6. stop_signal: SIGTERM
  7. depends_on:
  8. nginx: {condition: service_healthy, restart: true}
  9. no-restart:
  10. image: nginx:alpine
  11. init: true
  12. command: tail -f /dev/null
  13. stop_signal: SIGTERM
  14. depends_on:
  15. nginx: { condition: service_healthy }
  16. nginx:
  17. image: nginx:alpine
  18. labels:
  19. TEST: ${LABEL:-test}
  20. stop_signal: SIGTERM
  21. healthcheck:
  22. test: "echo | nc -w 5 localhost:80"
  23. interval: 2s
  24. timeout: 1s
  25. retries: 10