forked from openscrm/api-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
123 lines (118 loc) · 2.84 KB
/
docker-compose.yaml
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
119
120
121
122
123
version: '3'
services:
# redis服务
redis:
hostname: redis
image: redis:5.0.3
restart: always
command: redis-server /etc/redis.conf
environment:
- TZ=Asia/Shanghai
volumes:
- /etc/localtime:/etc/localtime:ro
- ./docker/data/redis/redis.conf:/etc/redis.conf
- ./docker/data/redis/db:/var/lib/redis
ports:
- 9379:9379
networks:
- openscrm
extra_hosts:
- "host.docker.internal:host-gateway"
# mysql数据库服务
mysql:
image: mysql
restart: always
environment:
TZ: Asia/Shanghai
# mysql root 密码
MYSQL_ROOT_PASSWORD: NWVj5IowIGk0dZlBCSF
# 初始化数据库(后续的初始化sql会在这个库执行)
MYSQL_DATABASE: open_scrm_demo
security_opt:
- seccomp:unconfined
command:
--default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
--port=9306
ports:
- 9306:9306
volumes:
- ./docker/data/mysql/db/:/var/lib/mysql/
- ./docker/data/mysql/conf/:/etc/mysql/conf.d/:ro
healthcheck:
test: [ "CMD", "mysqladmin" ,"ping", "-h", "mysql:9306" ]
timeout: 20s
retries: 10
networks:
- openscrm
extra_hosts:
- "host.docker.internal:host-gateway"
# nginx服务,前端项目挂载在此处
nginx:
image: daocloud.io/library/nginx:1.14
restart: always
privileged: true
environment:
- TZ=Asia/Shanghai
ports:
- 9000:9000
volumes:
- /etc/localtime:/etc/localtime
- ./docker/data/nginx/conf/conf.d/:/etc/nginx/conf.d/
- ./docker/data/nginx/logs:/var/log/nginx
- ./docker/data/dashboard:/opt/dashboard
- ./docker/data/sidebar:/opt/sidebar
- ./docker/data/nginx/conf/nginx.conf:/etc/nginx/nginx.conf
networks:
- openscrm
extra_hosts:
- "host.docker.internal:host-gateway"
# 主Api服务
api-server:
image: centos
volumes:
- ./bin/api-server:/srv/api-server
- ./conf/:/conf/
ports:
- 9001:9001
command:
- sh
- -c
- |
/srv/api-server
depends_on:
- msg-archive-server
- redis
- mysql
networks:
- openscrm
extra_hosts:
- "host.docker.internal:host-gateway"
# 会话存档服务
msg-archive-server:
image: centos
volumes:
- ./bin/msg-arch-server:/srv/msg-arch-server
- ./docker/lib:/srv/lib
- ./conf/:/conf/
ports:
- 9002:9002
environment:
- LD_LIBRARY_PATH=/srv/lib
command:
- sh
- -c
- |
/srv/msg-arch-server
depends_on:
- redis
- mysql
networks:
- openscrm
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
openscrm:
driver: bridge