-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
66 lines (63 loc) · 1.96 KB
/
docker-compose.yml
File metadata and controls
66 lines (63 loc) · 1.96 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
56
57
58
59
60
61
62
63
64
65
66
version: '3'
services:
go-rag:
image: iwangle/go-rag:v0.0.3
# build:
# context: .
# dockerfile: Dockerfile
ports:
- "8000:8000"
restart: unless-stopped
environment:
- TZ=Asia/Shanghai
- ES_HOST=elasticsearch
- ES_PORT=9200
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_USER=root
- MYSQL_PASSWORD=123456
- MYSQL_DATABASE=go-rag
volumes:
# 如果需要持久化配置或数据,可以添加相应的卷挂载,目前是在构建镜像时就copy过去的
- ./server/manifest/config/config.yaml:/app/manifest/config/config.yaml
depends_on:
mysql:
condition: service_healthy
elasticsearch:
condition: service_healthy
elasticsearch:
image: elasticsearch:8.11.3
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- "cluster.routing.allocation.disk.watermark.low=1gb" # 低于 1GB 停止分配
- "cluster.routing.allocation.disk.watermark.high=1gb" # 低于 1GB 迁移分片
- "cluster.routing.allocation.disk.watermark.flood_stage=1gb" # 低于 1GB 设为只读
ports:
- "9200:9200"
volumes:
- ./data/es_data:/usr/share/elasticsearch/data
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "curl -f http://localhost:9200/_cluster/health || exit 1" ]
interval: 10s
timeout: 5s
retries: 10
mysql:
image: mysql:8.0
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=go-rag
- MYSQL_ROOT_HOST=% # 允许root从任意主机连接
- MYSQL_CHARSET=utf8mb4 # 设置数据库字符集为utf8mb4
ports:
- "3306:3306"
volumes:
- ./data/mysql_data:/var/lib/mysql
restart: unless-stopped
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p123456" ]
interval: 10s
timeout: 5s
retries: 10