-
Notifications
You must be signed in to change notification settings - Fork 54
/
docker-compose.yaml
107 lines (105 loc) · 3.11 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
services:
# 基础服务,可根据情况替换成第三方
redis:
image: redis:6.2-rc3-alpine3.13
restart: always
environment:
TZ: ${TZ}
# 端口映射,非必要
ports:
- 63790:6379
volumes:
- ${REDIS_DATA}:/data
- ${REDIS_LOG}:/logs
healthcheck:
start_period: 5s
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 5s
retries: 5
command: redis-server --port 6379 --requirepass ${REDIS_PASSWORD} --appendonly yes
mysql:
image: mysql:8.4.3 # 指定镜像和版本, 避免不兼容
restart: always # 指定开机重启
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1
# 端口映射,非必要
ports:
- 33060:3306
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
SQL_MODE: "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
volumes:
- ./config/mysql/:/etc/mysql/conf.d
- ./config/initSql/:/docker-entrypoint-initdb.d/
- ${BASE_PATH}/mysql:/var/lib/mysql:rw # 挂载数据目录
healthcheck:
start_period: 15s
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
timeout: 20s
retries: 10
# 主要服务
wvp:
build:
context: ./buildFiles/wvp
dockerfile: Dockerfile
restart: always
environment:
TZ: ${TZ}
SIP_DOMAIN: ${SIP_DOMAIN}
SIP_ID: ${SIP_ID}
SIP_PASSWORD: ${SIP_PASSWORD}
WVP_IP: ${WVP_IP}
SIP_IP: ${SIP_IP}
SHOW_IP: ${SHOW_IP}
SDP_IP: ${SDP_IP}
ZLM_IP: ${ZLM_IP}
WVP_DB_PATH: ${WVP_DB_PATH}
MYSQL_USERNAME: ${MYSQL_USERNAME}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
REDIS_HOST: ${REDIS_HOST}
REDIS_PORT: ${REDIS_PORT}
REDIS_PWD: ${REDIS_PASSWORD}
STREAM_HOST: ${STREAM_HOST}
DRUID_USER: ${DRUID_USER}
DRUID_PASS: ${DRUID_PASS}
JT1078_PORT: ${JT1078_PORT}
JT1078_PASS: ${JT1078_PASS}
ports:
- 5060:5060
- 5060:5060/udp
- ${JT1078_PORT}:${JT1078_PORT}
- ${JT1078_PORT}:${JT1078_PORT}/udp
- 3000:3000
volumes:
- ./config/wvp:/config
- ${BASE_PATH}/logs/wvp:/opt/wvp/logs # 保存wvp日志
healthcheck:
start_period: 15s
test: [ "CMD", "curl", "-sS", "http://localhost:3000" ]
timeout: 10s
retries: 10
depends_on:
zlm:
condition: service_started
mysql:
condition: service_healthy
redis:
condition: service_healthy
zlm:
image: zlmediakit/zlmediakit:master
restart: always
environment:
TZ: ${TZ}
ports:
- ${STREAM_PORT}:${STREAM_PORT}/udp
- ${STREAM_PORT}:${STREAM_PORT}/tcp
- 3001:3001
volumes:
- ./config/zlm/config.ini:/opt/media/conf/config.ini
- ${RECORD_PATH}:/media/record:rw # 录像保存目录
- ${BASE_PATH}/logs/media:/opt/media/log # 保存zlm日志
healthcheck:
start_period: 30s
test: [ "CMD", "curl", "-sS", "http://localhost:3001" ]
timeout: 10s
retries: 10