forked from zhanglei/BridgX
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun-for-mac.sh
43 lines (36 loc) · 1.67 KB
/
run-for-mac.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
#!/usr/bin/env bash
read -r -p "Are you sure to install mysql? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Installing mysql..."
# deploy mysql
docker run -d --name bridgx_db -e MYSQL_ROOT_PASSWORD=mtQ8chN2 -e MYSQL_DATABASE=bridgx -e MYSQL_USER=gf -e [email protected] -p 3306:3306 -v $(pwd)/init/mysql:/docker-entrypoint-initdb.d yobasystems/alpine-mariadb:10.5.11
;;
[nN][oO]|[nN])
echo "Skip mysql install, please check conf/config.yml mysql config, and import init/mysql/* to existing mysql for first install."
;;
*)
echo "Invalid input..."
exit 1
;;
esac
read -r -p "Are you sure to install etcd? [Y/N] " input
case $input in
[yY][eE][sS]|[yY])
echo "Installing etcd..."
# deploy etcd
docker run -d --name bridgx_etcd --platform linux/amd64 -e ALLOW_NONE_AUTHENTICATION=yes -e ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379 -p 2379:2379 -p 2380:2380 bitnami/etcd:3
;;
[nN][oO]|[nN])
echo "Skip etcd install, please check conf/config.yml etcd config."
;;
*)
echo "Invalid input..."
exit 1
;;
esac
# deploy api
sed "s/127.0.0.1/host.docker.internal/g" $(pwd)/conf/config.yml.prod > $(pwd)/conf/config.yml.mac
docker run -d --name bridgx_api --platform linux/amd64 --add-host host.docker.internal:host-gateway -v $(pwd)/conf/config.yml.mac:/home/tiger/api/conf/config.yml.prod -p 9099:9090 galaxyfuture/bridgx-api:latest bin/wait-for-api.sh
# deploy sheduler
docker run -d --name bridgx_scheduler --platform linux/amd64 --add-host host.docker.internal:host-gateway -v $(pwd)/conf/config.yml.mac:/home/tiger/scheduler/conf/config.yml.prod galaxyfuture/bridgx-scheduler:latest bin/wait-for-scheduler.sh