Merge pull request #819 from SkynetLabs/new-dc-command

use dc command instead of docker-compose directly
This commit is contained in:
Ivaylo Novakov 2021-05-31 11:29:53 +02:00 committed by GitHub
commit dc1d2a2112
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

27
dc Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
if [ -f .env ]; then
export $(cat .env | sed 's/#.*//g' | xargs)
fi
# include base docker compose file
COMPOSE_FILES="-f docker-compose.yml"
for i in $(seq 1 ${#PORTAL_MODULES}); do
# accounts module - alias "a"
if [ ${PORTAL_MODULES:i-1:1} == "a" ]; then
COMPOSE_FILES+=" -f docker-compose.accounts.yml"
fi
# jaeger module - alias "j"
if [ ${PORTAL_MODULES:i-1:1} == "j" ]; then
COMPOSE_FILES+=" -f docker-compose.jaeger.yml"
fi
done
# override file if exists
if [ -f docker-compose.override.yml ]; then
COMPOSE_FILES+=" -f docker-compose.override.yml"
fi
docker-compose $COMPOSE_FILES $@