Livrare LOT 1 - Didi
This commit is contained in:
commit
5380c3fc63
990 changed files with 133308 additions and 0 deletions
50
ai_platform/modules/dashboard/deploy/deploy.sh
Normal file
50
ai_platform/modules/dashboard/deploy/deploy.sh
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
[[ -f .env ]] && set -a && source .env && set +a
|
||||
|
||||
check_required_var() {
|
||||
if [[ -z "${!1:-}" ]]; then
|
||||
echo "ERROR: Required variable $1 not set (check .env)"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: ./deploy.sh {up|down|logs|restart}
|
||||
|
||||
Actions:
|
||||
up Build and start dashboard + database
|
||||
down Stop containers (volumes preserved)
|
||||
logs Tail logs
|
||||
restart Restart dashboard without rebuild
|
||||
EOF
|
||||
}
|
||||
|
||||
check_required_var DASHBOARD_DB_USER
|
||||
check_required_var DASHBOARD_DB_PASSWORD
|
||||
check_required_var DASHBOARD_DB_NAME
|
||||
check_required_var DASHBOARD_EXTERNAL_URL
|
||||
|
||||
case "${1:-}" in
|
||||
up)
|
||||
docker compose --profile dashboard up -d --build
|
||||
echo "Dashboard started at ${DASHBOARD_EXTERNAL_URL}"
|
||||
;;
|
||||
down)
|
||||
docker compose --profile dashboard down
|
||||
;;
|
||||
logs)
|
||||
docker compose --profile dashboard logs -f --tail=100
|
||||
;;
|
||||
restart)
|
||||
docker compose --profile dashboard restart
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue