feat: 新增文件
This commit is contained in:
38
dev.sh
Executable file
38
dev.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
# Local dev entrypoint (all-in-one container: Node + Python).
|
||||
# Usage:
|
||||
# ./dev.sh # up --build (foreground)
|
||||
# ./dev.sh up # same as above
|
||||
# ./dev.sh up -d # detached
|
||||
# ./dev.sh logs # follow logs
|
||||
# ./dev.sh down # stop and remove
|
||||
# ./dev.sh rebuild # rebuild image
|
||||
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$ROOT_DIR"
|
||||
|
||||
CMD="${1:-up}"
|
||||
shift || true
|
||||
|
||||
case "$CMD" in
|
||||
up)
|
||||
docker compose up --build "$@"
|
||||
;;
|
||||
rebuild)
|
||||
docker compose build "$@"
|
||||
;;
|
||||
logs)
|
||||
docker compose logs -f --tail=200 "$@"
|
||||
;;
|
||||
down)
|
||||
docker compose down "$@"
|
||||
;;
|
||||
*)
|
||||
echo "Unknown command: $CMD" >&2
|
||||
echo "Usage: ./dev.sh [up|rebuild|logs|down] [args...]" >&2
|
||||
exit 2
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user