Skip to content

Commit 9b4428e

Browse files
committed
feat: add project name to Docker Compose for isolated environments
Previously, running multiple environments (e.g., production and staging) with the same `docker-compose` file caused containers from one environment to replace those from another. This happened because Docker Compose treated them as part of the same project due to the shared file name. To fix this, we now set the `name` field in `docker-compose.yaml` using `${APP_ENV}`, ensuring that each environment gets a unique project name. This prevents conflicts and allows production and staging containers to run simultaneously without interfering with each other. Additionally, this approach improves visibility by defining the project name directly in the compose file rather than relying on the CLI `--project-name` option.
1 parent 19f3cee commit 9b4428e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compose.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: ${APP_ENV}
12
services:
23
frontend:
34
depends_on:

0 commit comments

Comments
 (0)