docker-compose.yml 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. version: "3.2"
  2. services:
  3. web:
  4. image: busybox
  5. deploy:
  6. mode: replicated
  7. replicas: 6
  8. labels: [FOO=BAR]
  9. update_config:
  10. parallelism: 3
  11. delay: 10s
  12. failure_action: continue
  13. monitor: 60s
  14. max_failure_ratio: 0.3
  15. resources:
  16. limits:
  17. cpus: '0.001'
  18. memory: 50M
  19. reservations:
  20. cpus: '0.0001'
  21. memory: 20M
  22. restart_policy:
  23. condition: on_failure
  24. delay: 5s
  25. max_attempts: 3
  26. window: 120s
  27. placement:
  28. constraints: [node=foo]
  29. healthcheck:
  30. test: cat /etc/passwd
  31. interval: 10s
  32. timeout: 1s
  33. retries: 5
  34. volumes:
  35. - source: /host/path
  36. target: /container/path
  37. type: bind
  38. read_only: true
  39. - source: foobar
  40. type: volume
  41. target: /container/volumepath
  42. - type: volume
  43. target: /anonymous
  44. - type: volume
  45. source: foobar
  46. target: /container/volumepath2
  47. volume:
  48. nocopy: true
  49. stop_grace_period: 20s
  50. volumes:
  51. foobar:
  52. labels:
  53. com.docker.compose.test: 'true'