53 lines
1.2 KiB
Bash

#!/bin/bash
set -e
set -o ignoreeof
echo "Bash script launching COSS_ARCHIVING..."
# CHANGE ME ONCE!
export CONTAINER_DATA=/mnt/media/@Bulk/COSS/Downloads/coss_archiving
export UNAME=remy
export U_ID=1000
if [[ $1 == "debug" ]]
then
export DEBUG=true
export HEADFULL=true
export CODE=./
export ENTRYPOINT=/bin/bash
# since service ports does not open ports on implicitly started containers, also start chrome:
docker compose up -d chrome
elif [[ $1 == "production" ]]
then
export DEBUG=false
elif [[ $1 == "build" ]]
then
export DEBUG=false
docker compose build
exit 0
elif [[ $1 == "down" ]]
then
docker compose stop
exit 0
elif [[ $1 == "init" ]]
then
export CODE=./
export HEADFULL=true
docker compose up -d chrome
sleep 5
docker compose exec chrome /bin/bash /code/chrome/change_configuration.sh
else
echo "Please specify the execution mode (debug/production/build) as the first argument"
exit 1
fi
shift # consumes the variable set in $1 so that $@ only contains the remaining arguments
docker compose run -it --service-ports "$@"
echo "Docker run finished, shutting down containers..."
docker compose stop
echo "Bye!"