#!/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 dosnt 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 $?