-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.py
More file actions
41 lines (32 loc) · 1.76 KB
/
startup.py
File metadata and controls
41 lines (32 loc) · 1.76 KB
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
# This is to startup docker based dev environment
# What this script will do
# 1 - Startup Redis docker container (can skip by commenting the relevant section "Redis Startup")
# 2 - Startup Mysql docker container
# 3 - Startup Angular container (which will have Angular app deployed on port 4200)
# 4 - Startup Php docker container (which will esentially have the full app deployed)
import docker
from configparser import ConfigParser
client = docker.APIClient(base_url='unix://var/run/docker.sock')
######################### Read Configuration file #########################
config = ConfigParser()
config.read('config.ini')
######################### Redis Startup #########################
redis_docker_container_name = config.get(
'docker_containers', 'redis_docker_container_name')
client.start(redis_docker_container_name)
print("LOG::INFO: {} docker container started".format(redis_docker_container_name))
######################### Mysql Startup #########################
mysql_docker_container_name = config.get(
'docker_containers', 'mysql_docker_container_name')
client.start(mysql_docker_container_name)
print("LOG::INFO: {} docker container started".format(mysql_docker_container_name))
######################### Angular Startup #########################
angular_docker_container_name = config.get(
'docker_containers', 'angular_docker_container_name')
client.start(angular_docker_container_name)
print("LOG::INFO: {} docker container started".format(angular_docker_container_name))
######################### Php Startup #########################
php_docker_container_name = config.get(
'docker_containers', 'php_docker_container_name')
client.start(php_docker_container_name)
print("LOG::INFO: {} docker container started".format(php_docker_container_name))