forked from veops/cmdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
118 lines (110 loc) · 2.73 KB
/
docker-compose.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
version: '3.5'
services:
cmdb-db:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-db:1.0
container_name: cmdb-db
environment:
TZ: Asia/Shanghai
MYSQL_ROOT_PASSWORD: '123456'
MYSQL_DATABASE: 'cmdb'
MYSQL_USER: 'cmdb'
MYSQL_PASSWORD: '123456'
volumes:
- db-data:/var/lib/mysql
- ./docs/cmdb_en.sql:/docker-entrypoint-initdb.d/cmdb.sql
networks:
new:
aliases:
- mysql
cmdb-cache:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-cache:1.0
container_name: cmdb-cache
networks:
new:
aliases:
- redis
cmdb-search:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-search:1.2
# build:
# context: .
# target: cmdb-search
container_name: cmdb-search
environment:
- discovery.type=single-node
- cluster.name=docker-cluster
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
nofile:
soft: 65536
hard: 65536
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
new:
aliases:
- cmdb-search
cmdb-api:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-api:2.2
# build:
# context: .
# target: cmdb-api
container_name: cmdb-api
environment:
TZ: Asia/Shanghai
WAIT_HOSTS: cmdb-db:3306, cmdb-cache:6379, cmdb-search:9200
command:
- /bin/sh
- -c
- |
sed -i "s#USE_ES = False#USE_ES = True#g" settings.py
sed -i "s#USE_ACL = False#USE_ACL = True#g" settings.py
sed -i "s#ES_HOST = '127.0.0.1'#ES_HOST = 'cmdb-search'#g" settings.py
/wait
sleep 5
gunicorn --workers=3 autoapp:app -b 0.0.0.0:5000 -D
flask init-cache
flask init-acl
celery worker -A celery_worker.celery -E -Q cmdb_async --concurrency=1
depends_on:
- cmdb-db
- cmdb-cache
- cmdb-search
networks:
new:
aliases:
- cmdb-api
cmdb-ui:
image: registry.cn-qingdao.aliyuncs.com/pycook/cmdb-ui:2.2
# build:
# context: .
# target: cmdb-ui
container_name: cmdb-ui
depends_on:
- cmdb-api
environment:
TZ: Asia/Shanghai
CMDB_API_HOST: cmdb-api:5000
NGINX_PORT: 80
volumes:
- ./docs/nginx.cmdb.conf.example:/etc/nginx/conf.d/nginx.cmdb.conf.example
command:
- /bin/sh
- -c
- |
envsubst '$$CMDB_API_HOST $$NGINX_PORT' < /etc/nginx/conf.d/nginx.cmdb.conf.example > /etc/nginx/conf.d/cmdb.conf
nginx -g 'daemon off;'
networks:
- new
ports:
- "8000:80"
volumes:
db-data:
esdata:
networks:
new: