forked from VoAPI/VoAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
55 lines (51 loc) · 1.44 KB
/
Copy pathdocker-compose.yml
File metadata and controls
55 lines (51 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
services:
redis-voapi:
image: redis:latest
container_name: redis-voapi
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
start_period: 10s
db-voapi:
image: mysql:8.0.43
restart: always
container_name: db-voapi
ports:
- '3307:3306'
volumes:
- ./data:/var/lib/mysql # 挂载目录,持久化存储
- ./init-db.sql:/docker-entrypoint-initdb.d/init-db.sql # 初始化数据库脚本
environment:
TZ: Asia/Shanghai # 设置时区
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # 允许空密码
MYSQL_USER: voapi # 创建专用用户
MYSQL_PASSWORD: voapi123 # 设置专用用户密码
MYSQL_DATABASE: voapi # 自动创建数据库
command: --max_connections=5000 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 3s
retries: 5
start_period: 30s
voapi-app:
image: voapi/voapi:latest
restart: always
container_name: voapi-app
depends_on:
db-voapi:
condition: service_healthy
redis-voapi:
condition: service_healthy
volumes:
- ./config.yml:/config.yml
- ./file:/file
- ./public:/public
ports:
- "6800:6800"
networks:
network:
external: true