2021-05-28 14:09:45 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
if [ -f .env ]; then
|
2021-05-31 12:36:47 +00:00
|
|
|
OLD_IFS=$IFS; IFS=$'\n'; for x in `grep -v '^#.*' .env`; do export $x; done; IFS=$OLD_IFS
|
2021-05-28 14:09:45 +00:00
|
|
|
fi
|
|
|
|
|
2021-05-28 15:55:15 +00:00
|
|
|
# include base docker compose file
|
|
|
|
COMPOSE_FILES="-f docker-compose.yml"
|
|
|
|
|
2021-05-28 14:09:45 +00:00
|
|
|
for i in $(seq 1 ${#PORTAL_MODULES}); do
|
|
|
|
# accounts module - alias "a"
|
2021-05-31 12:36:47 +00:00
|
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "a" ]]; then
|
2021-10-07 09:43:09 +00:00
|
|
|
COMPOSE_FILES+=" -f docker-compose.mongodb.yml -f docker-compose.accounts.yml"
|
2021-05-28 14:09:45 +00:00
|
|
|
fi
|
|
|
|
|
2021-12-13 09:42:46 +00:00
|
|
|
# abuse module - alias "c"
|
|
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "c" ]]; then
|
2021-12-14 08:57:14 +00:00
|
|
|
COMPOSE_FILES+=" -f docker-compose.mongodb.yml -f docker-compose.blocker.yml -f docker-compose.abuse.yml"
|
2021-12-13 09:42:46 +00:00
|
|
|
fi
|
|
|
|
|
2021-12-01 10:02:55 +00:00
|
|
|
# blocker module - alias "b"
|
|
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "b" ]]; then
|
|
|
|
COMPOSE_FILES+=" -f docker-compose.blocker.yml"
|
|
|
|
fi
|
|
|
|
|
2021-05-28 14:09:45 +00:00
|
|
|
# jaeger module - alias "j"
|
2021-05-31 12:36:47 +00:00
|
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "j" ]]; then
|
2021-05-28 14:09:45 +00:00
|
|
|
COMPOSE_FILES+=" -f docker-compose.jaeger.yml"
|
|
|
|
fi
|
2021-10-07 09:43:09 +00:00
|
|
|
|
|
|
|
# mongodb module - alias "m". implied by "a"
|
|
|
|
if [[ ${PORTAL_MODULES:i-1:1} == "m" ]]; then
|
|
|
|
COMPOSE_FILES+=" -f docker-compose.mongodb.yml"
|
|
|
|
fi
|
2021-05-28 14:09:45 +00:00
|
|
|
done
|
|
|
|
|
|
|
|
# override file if exists
|
2021-05-31 12:36:47 +00:00
|
|
|
if [[ -f docker-compose.override.yml ]]; then
|
2021-05-28 14:09:45 +00:00
|
|
|
COMPOSE_FILES+=" -f docker-compose.override.yml"
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker-compose $COMPOSE_FILES $@
|