/
run_in_prod.sh
executable file
·59 lines (36 loc) · 1003 Bytes
/
run_in_prod.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
#!/usr/bin/env bash
set -e -x
pushd "$(pwd)"
function teardown() {
docker-compose down --remove-orphans || true
popd >/dev/null 2>&1
}
trap teardown ERR
CCTV_EVENTS_QUOTA=2000
CCTV_EVENTS_PATH="/media/storage/Cameras/events"
CCTV_SEGMENTS_QUOTA=4000
CCTV_SEGMENTS_PATH="/media/storage/Cameras/segments"
CCTV_SEGMENT_DURATION=300
CCTV_MOTION_CONFIGS="$(pwd)/motion-configs-run-in-prod"
CCTV_EXPOSE_PORT=81
export CCTV_EVENTS_QUOTA
export CCTV_EVENTS_PATH
export CCTV_SEGMENTS_QUOTA
export CCTV_SEGMENTS_PATH
export CCTV_SEGMENT_DURATION
export CCTV_MOTION_CONFIGS
export CCTV_EXPOSE_PORT
export DOCKER_BUILDKIT=1
export HASURA_GRAPHQL_ENDPOINT="http://localhost:8082/"
docker-compose down --remove-orphans || true
docker volume rm cameranator_front-end || true
docker-compose up -d nginx postgres hasura motion
cd persistence/hasura
while ! hasura migrate apply; do
sleep 1
done
hasura metadata apply
hasura seeds apply || true
popd
docker-compose up -d
docker-compose ps -a