From ef8ee67553d5487f6fce55c1e2c31788a61cf14c Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 19 Feb 2025 18:32:50 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F(compose)=20set=20compose=20n?= =?UTF-8?q?ame=20in=20the=20docker-compose=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The helper bin/compose was using the option -p to set the compose project name but this option is not used in the Makefile. This can lead to different way to use the docker compose file definition with different project name. In order to have a consistent name everywhere and for everybody, we set the name in the docker compose file itself. --- bin/_config.sh | 4 +--- docker-compose.yml | 2 ++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/_config.sh b/bin/_config.sh index 5ec03c46..854222a5 100644 --- a/bin/_config.sh +++ b/bin/_config.sh @@ -7,7 +7,6 @@ UNSET_USER=0 TERRAFORM_DIRECTORY="./env.d/terraform" COMPOSE_FILE="${REPO_DIR}/docker-compose.yml" -COMPOSE_PROJECT="docs" # _set_user: set (or unset) default user id used to run docker commands @@ -40,9 +39,8 @@ function _set_user() { # ARGS : docker compose command arguments function _docker_compose() { - echo "🐳(compose) project: '${COMPOSE_PROJECT}' file: '${COMPOSE_FILE}'" + echo "🐳(compose) file: '${COMPOSE_FILE}'" docker compose \ - -p "${COMPOSE_PROJECT}" \ -f "${COMPOSE_FILE}" \ --project-directory "${REPO_DIR}" \ "$@" diff --git a/docker-compose.yml b/docker-compose.yml index 84ad1b03..97ad835f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,3 +1,5 @@ +name: docs + services: postgresql: image: postgres:16