ckst commited on
Commit
5e75a8d
·
verified ·
1 Parent(s): d7360c2

Create docker-compose.yml

Browse files
Files changed (1) hide show
  1. docker-compose.yml +33 -0
docker-compose.yml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ version: '3.4'
2
+
3
+ services:
4
+ voapi:
5
+ image: voapi/voapi:latest
6
+ container_name: voapi
7
+ restart: always
8
+ command: --log-dir /app/logs
9
+ ports:
10
+ - "3000:3000"
11
+ volumes:
12
+ - ./data:/data
13
+ - ./logs:/app/logs
14
+ extra_hosts:
15
+ - "host.docker.internal:host-gateway"
16
+ environment:
17
+ - SQL_DSN=root:123456@tcp(host.docker.internal:3306)/voapi?charset=utf8mb4&parseTime=True&loc=Local # 修改此行,或注释掉以使用 SQLite 作为数据库
18
+ - REDIS_CONN_STRING=redis://redis
19
+ - SESSION_SECRET=random_string # 启动前必须手动修改此值为随机字符串
20
+ - TZ=Asia/Shanghai
21
+
22
+ depends_on:
23
+ - redis
24
+ healthcheck:
25
+ test: [ "CMD-SHELL", "wget -q -O - http://localhost:3000/api/status | grep -o '\"success\":\\s*true' | awk -F: '{print $2}'" ]
26
+ interval: 30s
27
+ timeout: 10s
28
+ retries: 3
29
+
30
+ redis:
31
+ image: redis:latest
32
+ container_name: redis
33
+ restart: always