forked from mtusi2026/mtusi2026lab2
build(docker): add Compose stack with migrations and persistent storage
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
project_dir=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
||||
cd "$project_dir"
|
||||
|
||||
for service in backend postgres redis; do
|
||||
if [ -z "$(docker compose ps --all --quiet "$service")" ]; then
|
||||
printf '%s\n' "Missing container for $service; start the Compose stack first." >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
docker compose stop --timeout 10 backend postgres redis
|
||||
docker compose up --detach --no-recreate --no-build --no-deps --wait --wait-timeout 45 postgres redis
|
||||
docker compose up --detach --no-recreate --no-build --no-deps backend
|
||||
Reference in New Issue
Block a user