Added watchdog for celery in dev mode to apply changes Fix Overwritten of worker settings. Priority keys over .env overwrites Chore: Script fixes of master,worker
55 lines
1.4 KiB
Bash
Executable File
55 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -e
|
|
|
|
|
|
show_help() {
|
|
echo "Usage: $0 [OPTIONS]"
|
|
echo ""
|
|
echo "Options:"
|
|
echo " --build Rebuild containers without cache and start services"
|
|
echo " --clean Remove containers, volumes, images, and rebuild everything"
|
|
echo " --help Show this help message"
|
|
}
|
|
|
|
# Detect docker compose command
|
|
if command -v docker-compose >/dev/null 2>&1; then
|
|
DOCKER_COMPOSE="docker-compose"
|
|
elif docker compose version >/dev/null 2>&1; then
|
|
DOCKER_COMPOSE="docker compose"
|
|
else
|
|
echo "Error: Neither docker-compose nor docker compose is installed."
|
|
exit 1
|
|
fi
|
|
|
|
CLEAN=false
|
|
BUILD=false
|
|
|
|
for arg in "$@"; do
|
|
case "$arg" in
|
|
--clean) CLEAN=true ;;
|
|
--build) BUILD=true ;;
|
|
--help) show_help; exit 0 ;;
|
|
*)
|
|
echo "Unknown option: $arg"
|
|
echo ""
|
|
show_help
|
|
exit 1
|
|
;;
|
|
esac
|
|
done
|
|
|
|
if $CLEAN; then
|
|
echo "Cleaning containers, volumes, images, and orphans..."
|
|
$DOCKER_COMPOSE down -v --rmi all --remove-orphans
|
|
echo "Rebuilding containers without cache..."
|
|
$DOCKER_COMPOSE build --no-cache
|
|
elif $BUILD; then
|
|
echo "Stopping existing containers before rebuild..."
|
|
$DOCKER_COMPOSE down -v
|
|
echo "Building containers without cache..."
|
|
$DOCKER_COMPOSE build --no-cache
|
|
fi
|
|
|
|
echo "Starting services..."
|
|
$DOCKER_COMPOSE up -d |