38 lines
1.0 KiB
Bash
Executable File
38 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ -f .env ]; then
|
|
OLD_IFS=$IFS; IFS=$'\n'; for x in `grep -v '^#.*' .env`; do export $x; done; IFS=$OLD_IFS
|
|
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.mongodb.yml -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
|
|
|
|
# malware-scanner module - alias "s"
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "s" ]]; then
|
|
COMPOSE_FILES+=" -f docker-compose.mongodb.yml -f docker-compose.malware-scanner.yml"
|
|
fi
|
|
|
|
# mongodb module - alias "m". implied by "a" and "c"
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "m" ]]; then
|
|
COMPOSE_FILES+=" -f docker-compose.mongodb.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 $@
|