docker-compose.yml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. version: "3.5"
  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.05'
  18. memory: 50M
  19. reservations:
  20. cpus: '0.01'
  21. memory: 20M
  22. restart_policy:
  23. condition: on-failure
  24. delay: 5s
  25. max_attempts: 3
  26. window: 120s
  27. placement:
  28. constraints:
  29. - node.hostname==foo
  30. - node.role != manager
  31. preferences:
  32. - spread: node.labels.datacenter
  33. healthcheck:
  34. test: cat /etc/passwd
  35. interval: 10s
  36. timeout: 1s
  37. retries: 5
  38. volumes:
  39. - source: /host/path
  40. target: /container/path
  41. type: bind
  42. read_only: true
  43. - source: foobar
  44. type: volume
  45. target: /container/volumepath
  46. - type: volume
  47. target: /anonymous
  48. - type: volume
  49. source: foobar
  50. target: /container/volumepath2
  51. volume:
  52. nocopy: true
  53. stop_grace_period: 20s
  54. volumes:
  55. foobar:
  56. labels:
  57. com.docker.compose.test: 'true'