docker_compose.yaml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. command: docker compose
  2. short: Docker Compose
  3. long: "You can use compose subcommand, `docker compose [-f <arg>...] [options] [COMMAND]
  4. [ARGS...]`, to build and manage\nmultiple services in Docker containers.\n\n###
  5. Use `-f` to specify name and path of one or more Compose files\nUse the `-f` flag
  6. to specify the location of a Compose configuration file.\n\n#### Specifying multiple
  7. Compose files\nYou can supply multiple `-f` configuration files. When you supply
  8. multiple files, Compose combines them into a single \nconfiguration. Compose builds
  9. the configuration in the order you supply the files. Subsequent files override
  10. and add \nto their predecessors.\n\nFor example, consider this command line:\n\n```\n$
  11. docker-compose -f docker-compose.yml -f docker-compose.admin.yml run backup_db\n```\nThe
  12. `docker-compose.yml` file might specify a `webapp` service.\n\n```yaml\nservices:\n
  13. \ webapp:\n image: examples/web\n ports:\n - \"8000:8000\"\n volumes:\n
  14. \ - \"/data\"\n```\nIf the `docker-compose.admin.yml` also specifies this
  15. same service, any matching fields override the previous file. \nNew values, add
  16. to the `webapp` service configuration.\n\n```yaml\nservices:\n webapp:\n build:
  17. .\n environment:\n - DEBUG=1\n```\n\nWhen you use multiple Compose files,
  18. all paths in the files are relative to the first configuration file specified
  19. \nwith `-f`. You can use the `--project-directory` option to override this base
  20. path.\n\nUse a `-f` with `-` (dash) as the filename to read the configuration
  21. from stdin. When stdin is used all paths in the \nconfiguration are relative to
  22. the current working directory.\n\nThe `-f` flag is optional. If you don’t provide
  23. this flag on the command line, Compose traverses the working directory \nand its
  24. parent directories looking for a `compose.yaml` or `docker-compose.yaml` file.\n\n####
  25. Specifying a path to a single Compose file\nYou can use the `-f` flag to specify
  26. a path to a Compose file that is not located in the current directory, either
  27. \nfrom the command line or by setting up a `COMPOSE_FILE` environment variable
  28. in your shell or in an environment file.\n\nFor an example of using the `-f` option
  29. at the command line, suppose you are running the Compose Rails sample, and \nhave
  30. a `compose.yaml` file in a directory called `sandbox/rails`. You can use a command
  31. like `docker compose pull` to \nget the postgres image for the db service from
  32. anywhere by using the `-f` flag as follows: \n```\ndocker compose -f ~/sandbox/rails/compose.yaml
  33. pull db\n```\n\n### Use `-p` to specify a project name\n\nEach configuration has
  34. a project name. If you supply a `-p` flag, you can specify a project name. If
  35. you don’t \nspecify the flag, Compose uses the current directory name. \nProject
  36. name can also be set by `COMPOSE_PROJECT_NAME` environment variable.\n\nMost compose
  37. subcommand can be ran without a compose file, just passing \nproject name to retrieve
  38. the relevant resources.\n\n```\n$ docker compose -p my_project ps -a\nNAME SERVICE
  39. \ STATUS PORTS\nmy_project_demo_1 demo running \n\n$
  40. docker compose -p my_project logs\ndemo_1 | PING localhost (127.0.0.1): 56 data
  41. bytes\ndemo_1 | 64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.095 ms\n```\n\n###
  42. Use profiles to enable optional services\n\nUse `--profile` to specify one or
  43. more active profiles\nCalling `docker compose --profile frontend up` will start
  44. the services with the profile `frontend` and services \nwithout any specified
  45. profiles. \nYou can also enable multiple profiles, e.g. with `docker compose --profile
  46. frontend --profile debug up` the profiles `frontend` and `debug` will be enabled.\n\nProfiles
  47. can also be set by `COMPOSE_PROFILES` environment variable.\n\n### Set up environment
  48. variables\n\nYou can set environment variables for various docker-compose options,
  49. including the `-f`, `-p` and `--profiles` flags.\n\nSetting the `COMPOSE_FILE`
  50. environment variable is equivalent to passing the `-f` flag,\n`COMPOSE_PROJECT_NAME`
  51. environment variable does the same for to the `-p` flag,\nand so does `COMPOSE_PROFILES`
  52. environment variable for to the `--profiles` flag.\n\nIf flags are explicitly
  53. set on command line, associated environment variable is ignored"
  54. usage: docker compose
  55. pname: docker
  56. plink: docker.yaml
  57. cname:
  58. - docker compose build
  59. - docker compose convert
  60. - docker compose create
  61. - docker compose down
  62. - docker compose events
  63. - docker compose exec
  64. - docker compose images
  65. - docker compose kill
  66. - docker compose logs
  67. - docker compose ls
  68. - docker compose pause
  69. - docker compose port
  70. - docker compose ps
  71. - docker compose pull
  72. - docker compose push
  73. - docker compose restart
  74. - docker compose rm
  75. - docker compose run
  76. - docker compose start
  77. - docker compose stop
  78. - docker compose top
  79. - docker compose unpause
  80. - docker compose up
  81. clink:
  82. - docker_compose_build.yaml
  83. - docker_compose_convert.yaml
  84. - docker_compose_create.yaml
  85. - docker_compose_down.yaml
  86. - docker_compose_events.yaml
  87. - docker_compose_exec.yaml
  88. - docker_compose_images.yaml
  89. - docker_compose_kill.yaml
  90. - docker_compose_logs.yaml
  91. - docker_compose_ls.yaml
  92. - docker_compose_pause.yaml
  93. - docker_compose_port.yaml
  94. - docker_compose_ps.yaml
  95. - docker_compose_pull.yaml
  96. - docker_compose_push.yaml
  97. - docker_compose_restart.yaml
  98. - docker_compose_rm.yaml
  99. - docker_compose_run.yaml
  100. - docker_compose_start.yaml
  101. - docker_compose_stop.yaml
  102. - docker_compose_top.yaml
  103. - docker_compose_unpause.yaml
  104. - docker_compose_up.yaml
  105. options:
  106. - option: ansi
  107. value_type: string
  108. default_value: auto
  109. description: |
  110. Control when to print ANSI control characters ("never"|"always"|"auto")
  111. deprecated: false
  112. experimental: false
  113. experimentalcli: false
  114. kubernetes: false
  115. swarm: false
  116. - option: env-file
  117. value_type: string
  118. description: Specify an alternate environment file.
  119. deprecated: false
  120. experimental: false
  121. experimentalcli: false
  122. kubernetes: false
  123. swarm: false
  124. - option: file
  125. shorthand: f
  126. value_type: stringArray
  127. default_value: '[]'
  128. description: Compose configuration files
  129. deprecated: false
  130. experimental: false
  131. experimentalcli: false
  132. kubernetes: false
  133. swarm: false
  134. - option: no-ansi
  135. value_type: bool
  136. default_value: "false"
  137. description: Do not print ANSI control characters (DEPRECATED)
  138. deprecated: false
  139. experimental: false
  140. experimentalcli: false
  141. kubernetes: false
  142. swarm: false
  143. - option: profile
  144. value_type: stringArray
  145. default_value: '[]'
  146. description: Specify a profile to enable
  147. deprecated: false
  148. experimental: false
  149. experimentalcli: false
  150. kubernetes: false
  151. swarm: false
  152. - option: project-directory
  153. value_type: string
  154. description: |-
  155. Specify an alternate working directory
  156. (default: the path of the Compose file)
  157. deprecated: false
  158. experimental: false
  159. experimentalcli: false
  160. kubernetes: false
  161. swarm: false
  162. - option: project-name
  163. shorthand: p
  164. value_type: string
  165. description: Project name
  166. deprecated: false
  167. experimental: false
  168. experimentalcli: false
  169. kubernetes: false
  170. swarm: false
  171. - option: workdir
  172. value_type: string
  173. description: |-
  174. DEPRECATED! USE --project-directory INSTEAD.
  175. Specify an alternate working directory
  176. (default: the path of the Compose file)
  177. deprecated: false
  178. experimental: false
  179. experimentalcli: false
  180. kubernetes: false
  181. swarm: false
  182. deprecated: false
  183. experimental: false
  184. experimentalcli: false
  185. kubernetes: false
  186. swarm: false