Skip to content
Snippets Groups Projects
Commit 38b8ed5c authored by michael.minelli's avatar michael.minelli
Browse files

Infra => Update script to add CPU env var and env var file copy

parent 8995f434
Branches
No related tags found
No related merge requests found
......@@ -23,13 +23,17 @@ if [ $? -ne 0 ]; then
DOCKER_COMPOSE_COMMAND="docker-compose"
fi
${DOCKER_COMPOSE_COMMAND} kill
CPU_LIMIT=$(($(nproc)-1))
CPU_LIMIT=$(($CPU_LIMIT <= 0 ? 1 : $CPU_LIMIT))
CPU_LIMIT=${CPU_LIMIT} ${DOCKER_COMPOSE_COMMAND} kill
# If argument is --run, run the docker compose file
if [ "$1" = "--run" ]; then
# Check if .env file exists
if [ -f $ENV_FILE ]; then
${DOCKER_COMPOSE_COMMAND} --env-file ${ENV_FILE} up --build -d
cp -f $ENV_FILE API/$ENV_FILE
CPU_LIMIT=${CPU_LIMIT} ${DOCKER_COMPOSE_COMMAND} --env-file ${ENV_FILE} up --build -d
else
echo "Need a file named ${ENV_FILE} providing environment variables."
exit 2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment