@@ -63,12 +63,19 @@ long: |-
6363
6464 ### Use `-p` to specify a project name
6565
66- Each configuration has a project name. If you supply a `-p` flag, you can specify a project name. If you don’t
67- specify the flag, Compose uses the current directory name.
68- Project name can also be set by `COMPOSE_PROJECT_NAME` environment variable.
69-
70- Many Compose subcommands can be run without a Compose file by passing
71- the project name.
66+ Each configuration has a project name. Compose sets the project name using
67+ the following mechanisms, in order of precedence:
68+ - The `-p` command line flag
69+ - The `COMPOSE_PROJECT_NAME` environment variable
70+ - The top level `name:` variable from the config file (or the last `name:`
71+ from a series of config files specified using `-f`)
72+ - The `basename` of the project directory containing the config file (or
73+ containing the first config file specified using `-f`)
74+ - The `basename` of the current directory if no config file is specified
75+ Project names must contain only lowercase letters, decimal digits, dashes,
76+ and underscores, and must begin with a lowercase letter or decimal digit. If
77+ the `basename` of the project directory or current directory violates this
78+ constraint, you must use one of the other mechanisms.
7279
7380 ```console
7481 $ docker compose -p my_project ps -a
@@ -198,7 +205,8 @@ options:
198205 kubernetes : false
199206 swarm : false
200207 - option : env-file
201- value_type : string
208+ value_type : stringArray
209+ default_value : ' []'
202210 description : Specify an alternate environment file.
203211 deprecated : false
204212 hidden : false
0 commit comments