-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker.sh
executable file
·63 lines (57 loc) · 1022 Bytes
/
docker.sh
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
57
58
59
60
61
62
63
#!/bin/bash
BUILD=false
FRESH=false
DOWN=false
SSH=false
XDEBUG=false
while [[ $# -gt 0 ]]; do
case "$1" in
--build|-b)
BUILD=true
shift
;;
--fresh|-f)
FRESH=true
shift
;;
--down|-d)
DOWN=true
shift
;;
--ssh|-s)
SSH=true
shift
;;
--xdebug|-x)
XDEBUG=true
shift
;;
--)
shift
break
;;
*)
echo "Invalid option: $1"
exit 1 ## Could be optional.
;;
esac
done
if $DOWN; then
docker compose down
else
DEBUG_ENV=""
if $XDEBUG; then
DEBUG_ENV="WITH_XDEBUG=true"
fi
if $XDEBUG || $BUILD; then
eval "$DEBUG_ENV docker compose build"
fi
docker compose up -d
if $FRESH; then
docker compose exec shipengine-app composer install
docker compose exec shipengine-app composer fresh
fi
if $SSH; then
docker exec -it shipengine-app /bin/bash
fi
fi