phase 1
This commit is contained in:
21
ctrl/run.sh
21
ctrl/run.sh
@@ -3,14 +3,15 @@
|
||||
# Usage: ./run.sh [OPTIONS] [docker-compose args]
|
||||
#
|
||||
# Options:
|
||||
# -f, --foreground Run in foreground (don't detach)
|
||||
# -d, --detach Run detached (background)
|
||||
# --build Rebuild images before starting
|
||||
# stop Stop all services
|
||||
#
|
||||
# Examples:
|
||||
# ./run.sh # Start detached
|
||||
# ./run.sh -f # Start in foreground (see logs)
|
||||
# ./run.sh # Start attached (see logs)
|
||||
# ./run.sh -d # Start detached
|
||||
# ./run.sh --build # Rebuild and start
|
||||
# ./run.sh logs -f # Follow logs
|
||||
# ./run.sh stop # Stop all services
|
||||
|
||||
set -e
|
||||
|
||||
@@ -35,19 +36,23 @@ if ! grep -q "mpr.local.ar" /etc/hosts 2>/dev/null; then
|
||||
fi
|
||||
|
||||
# Parse options
|
||||
DETACH="-d"
|
||||
DETACH=""
|
||||
BUILD=""
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case $1 in
|
||||
-f|--foreground)
|
||||
DETACH=""
|
||||
-d|--detach)
|
||||
DETACH="-d"
|
||||
shift
|
||||
;;
|
||||
--build)
|
||||
BUILD="--build"
|
||||
shift
|
||||
;;
|
||||
stop)
|
||||
docker compose down
|
||||
exit $?
|
||||
;;
|
||||
*)
|
||||
# Pass remaining args to docker compose
|
||||
docker compose "$@"
|
||||
@@ -56,5 +61,5 @@ while [[ $# -gt 0 ]]; do
|
||||
esac
|
||||
done
|
||||
|
||||
# Default: up with options
|
||||
# Default: up attached
|
||||
docker compose up $DETACH $BUILD
|
||||
|
||||
Reference in New Issue
Block a user