-
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathcompose.sh
More file actions
executable file
·52 lines (48 loc) · 1.13 KB
/
compose.sh
File metadata and controls
executable file
·52 lines (48 loc) · 1.13 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
#!/bin/bash
# Define the base command using both production and dev override files
# This ensures we use the local build (from dev.yml) instead of the GHCR image
COMPOSE="docker compose -f docker-compose.yml -f docker-compose.dev.yml"
show_help() {
echo "Usage: ./compose.sh [command]"
echo ""
echo "Commands:"
echo " build Build the images"
echo " start Start the stack"
echo " restart Restart the stack"
echo " stop Stop the stack"
echo " down Stop and remove containers"
echo ""
}
# If no arguments provided, show help.
if [ -z "$1" ]; then
show_help
exit 1
fi
case "$1" in
start)
echo "Starting stack..."
$COMPOSE up -d
;;
restart)
echo "Restarting stack..."
$COMPOSE down
$COMPOSE up -d
;;
stop)
echo "Stopping stack..."
$COMPOSE stop
;;
down)
echo "Tearing down stack..."
$COMPOSE down
;;
build)
echo "Building stack..."
$COMPOSE build
;;
*)
echo "Error: Unknown command '$1'"
show_help
exit 1
;;
esac