forked from mtusi2026/mtusi2026lab2
21 lines
379 B
Bash
Executable File
21 lines
379 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
project_root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
cd "$project_root"
|
|
|
|
env_file=${ENV_FILE:-.env}
|
|
|
|
case "${CACHE_ACTION:-}" in
|
|
stop)
|
|
docker compose --env-file "$env_file" stop redis
|
|
;;
|
|
start)
|
|
docker compose --env-file "$env_file" up -d --wait redis
|
|
;;
|
|
*)
|
|
echo "CACHE_ACTION must be stop or start" >&2
|
|
exit 2
|
|
;;
|
|
esac
|