Files
romm/docker/init_scripts/init
2023-10-25 00:23:48 +02:00

28 lines
597 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit # treat errors as fatal
set -o nounset # treat unset variables as an error
set -o pipefail # treat errors in pipes as fatal
shopt -s inherit_errexit # inherit errexit
# use virtualenvs
source /backend/bin/activate
# switch to backend directory
cd /backend || { echo "/backend directory doesn't seem to exist"; exit 1; }
# Run migrations and start uvicorn
/init_back &
# Start nginx
/init_front &
# Start rq worker
/init_worker &
# Wait for any process to exit
wait -n
# Exit with status of process that exited first
exit $?