Skip to content

Commit

Permalink
rework docker compose script to allow future extensibility
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrkwiecinski committed Nov 10, 2023
1 parent ed64164 commit aef9ba7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions compose/bin/docker-compose
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,16 @@ else
DOCKER_COMPOSE="docker-compose"
fi

COMPOSE_FILES_LIST=("compose.yaml" "compose.healthcheck.yaml")

if [ "$1" == "--no-dev" ]; then
${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml "${@:2}"
# ensure --no-dev parameter isn't passed to docker compose
shift 1
else
${DOCKER_COMPOSE} -f compose.yaml -f compose.healthcheck.yaml -f compose.dev.yaml "$@"
COMPOSE_FILES_LIST+=("compose.dev.yaml")
fi

# Combine files, prefix each with -f
COMPOSE_FILES="${COMPOSE_FILES_LIST[@]/#/'-f '}"

${DOCKER_COMPOSE} ${COMPOSE_FILES} "$@"

0 comments on commit aef9ba7

Please sign in to comment.