-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·32 lines (25 loc) · 1.05 KB
/
setup.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
#!/bin/bash
echo ">>Info: starting infra"
docker-compose up -d kong kafka zookeeper
echo ">>Info: wait for 10 seconds to start infra"
sleep 10
echo ">>Info: starting menu service postgres"
docker-compose up -d menu_postgres
echo ">>Info: wait for 10 seconds to start postgres"
sleep 10
echo ">>Info: starting serach service elasticsearch"
docker-compose up -d search_elasticsearch
echo ">>Info: wait for 10 seconds to start elasticsearch"
sleep 10
echo ">>Info: starting serach service redis"
docker-compose up -d search_redis
echo ">>Info: wait for 5 seconds to start redis"
sleep 5
if ! docker exec -it kafka kafka-topics --list --bootstrap-server kafka:9092 | grep -q 'menuitems'; then
echo ">>Info: creating menu servie kafka topics"
docker exec -it kafka kafka-topics --create --bootstrap-server kafka:9092 --topic menuitems --partitions 1 --replication-factor 1
fi
echo ">>Info: starting service"
docker-compose build menu_service search_service customer_webui
docker-compose up -d menu_service search_service customer_webui
echo ">>Info: setup done"