docker_compose.yaml 8.0 KB

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