forked from mtusi2026/mtusi2026lab2
build(docker): add Compose stack with migrations and persistent storage
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
@echo off
|
||||
setlocal
|
||||
if defined GIT_BASH goto run
|
||||
set "GIT_BASH=%ProgramFiles%\Git\bin\bash.exe"
|
||||
if exist "%GIT_BASH%" goto run
|
||||
echo Git Bash was not found. Set GIT_BASH to the full path to bash.exe. 1>&2
|
||||
exit /b 2
|
||||
:run
|
||||
"%GIT_BASH%" "%~dp0restart.sh"
|
||||
exit /b %ERRORLEVEL%
|
||||
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