-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·28 lines (19 loc) · 904 Bytes
/
run.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
#!/bin/bash
##Create docker network
#sudo docker network create thousand_eyes
##create mysql_image image
#sudo docker build -t mysql_image -f dockerfile-mysql .
#create a volume directory on the host
sudo mkdir -p /storage/docker/mysql-datadir
##run the mysql DB docker
#sudo docker run --name "mysql_db" --env-file ./mysql_env -p 6000:3306 --network "thousand_eyes" --volume=/storage/docker/mysql-datadir:/var/lib/mysql -d mysql_image
##create python_app image
#sudo docker build -t python_app_image -f dockerfile-python .
##run the python application docker
#sudo docker run --name python_code -p 5000:5000 --network "thousand_eyes" -d python_app_image
####Modified run.sh after docker-compose####
#To start 1 mysql_db, 1 python_application, 1 load_balancer
sudo docker-compose up --build -d
#to scale the python_application to 5 applications
sudo docker-compose scale python_code=5
sleep 60