Set Docker Compose project name
Visual Studio Code will respect the value you configure for the Docker Composeproject name.
The top-level propertyname in thedocker-compose.yml can be used to set the project name.
Alternatively, you can set theCOMPOSE_PROJECT_NAME environment variable for the VS Code process, or specify it in a.env file in the same folder as thedocker-compose.yml.
Note: make sure to close all open VS Code windows first.
To start VS Code from the command line:
# from bashCOMPOSE_PROJECT_NAME=foo code .# from PowerShell$env:COMPOSE_PROJECT_NAME=foocode .Alternatively, add the following entry to a.env file in the same folder as thedocker-compose.yml:
COMPOSE_PROJECT_NAME=fooWhen no project name is configured and thedocker-compose.yml is in the.devcontainer folder, the Docker Compose default of using thedocker-compose.yml folder's basename is overridden with${project-folder-basename}_devcontainer to avoid name collisions with other projects.