-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_devmode.sh
More file actions
executable file
·56 lines (48 loc) · 1.59 KB
/
run_devmode.sh
File metadata and controls
executable file
·56 lines (48 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
# Start or stop a disposable dev-mode instance with dev tools included.
#
# Usage:
# ./run_devmode.sh # start (or restart) the dev-mode stack
# ./run_devmode.sh --stop # stop containers (preserves data)
# ./run_devmode.sh --down # tear down and remove volumes
# ./run_devmode.sh --no-build # start without rebuilding the image
#
# Ports: app=8002, postgres=5434, redis=6381
# Does not conflict with the normal dev stack (8000) or test suite (8001).
#
# To enable periodic demo wipe:
# DEMO_WIPE_ENABLED=true ./run_devmode.sh
set -euo pipefail
COMPOSE="docker compose -p sheaf-devmode -f docker-compose.yml -f docker-compose.devmode.yml"
if [[ "${1:-}" == "--stop" ]]; then
echo "Stopping dev-mode stack (data preserved)..."
$COMPOSE down
echo "Done."
exit 0
fi
if [[ "${1:-}" == "--down" ]]; then
echo "Tearing down dev-mode stack and removing volumes..."
$COMPOSE down -v
echo "Done."
exit 0
fi
BUILD_FLAG="--build"
if [[ "${1:-}" == "--no-build" ]]; then
BUILD_FLAG=""
fi
echo "Starting dev-mode stack (app=:8002, pg=:5434, redis=:6381)..."
$COMPOSE up -d $BUILD_FLAG
echo "Waiting for app..."
for i in $(seq 1 30); do
if curl -sf http://localhost:8002/health > /dev/null 2>&1; then
echo "Dev-mode stack ready at http://localhost:8002"
echo " API docs: http://localhost:8002/v1/docs"
echo " Postgres: localhost:5434 (sheaf/sheafdev)"
echo " Redis: localhost:6381"
exit 0
fi
sleep 1
done
echo "Timed out waiting for app. Check logs:"
echo " $COMPOSE logs app"
exit 1