-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-dev.sh
74 lines (58 loc) · 1.89 KB
/
start-dev.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
64
65
66
67
68
69
70
71
72
73
74
# start all relevant containers
# linkage is abstracted by run commands in other shell scripts
# different from main as we do not run server containers as daemon
# usage: bash start.sh
# create network for containers
docker network create application-network
# start database
echo "database"
cd database
bash run-container.sh
# start transaction database
echo "transaction database"
cd ../trxn_db
bash run-container.sh
# start elasticsearch server
echo "elasticsearch"
cd ../elasticsearch
bash run-container.sh
# start transaction server
echo "transaction server"
cd ../trxn_server
bash build-image.sh
bash run-container.sh
# start backend server
echo "server"
cd ../server
bash build-image.sh
bash run-container.sh
# start client
echo "client"
cd ../client
bash build-image.sh
bash run-container.sh
# KNOWN CAVEAT: container linking is not instantaneous so we enable a 1
# second delay such that server connects to db and es
echo "Time delay to allow for container linking..."
sleep 15
echo "building indices..."
# exec into es container and build indices
docker exec -it es bash es_util/setup.sh
echo "creating database tables..."
cd ../database
# relative file paths from database directory
bash exec.sh scripts/2017_11_23/release.sql
bash exec.sh scripts/2018_01_24/release.sql
bash exec.sh scripts/2018_01_28/release.sql
bash exec.sh scripts/2018_03_04/release.sql
bash exec.sh scripts/2018_03_11/release.sql
bash exec.sh scripts/2018_03_14/release.sql
echo "creating transaction database tables..."
cd ../trxn_db
bash exec.sh scripts/2018_01_22/release.sql
echo "starting app server..."
# dynamically create static folders for image and file uploads
docker exec -d server mkdir App/src/static_image
docker exec -d server mkdir App/src/static_file
# execute this command in terminal: docker exec -it server python App/src/app.py
# execute ths command in terminal: docker exec -it trxn_server python App/src/app.py