Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
144 lines (136 loc) · 4.15 KB
/
Copy pathdocker-compose.yml
File metadata and controls
144 lines (136 loc) · 4.15 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
# ===================================================================
# CodeRAG 基础设施(仅 infra;后端/前端/model_server 在本地 host 运行)
#
# docker compose up -d # 启动全部基础设施
# docker compose down # 停止
#
# 后端本地运行: cd backend && uv run uvicorn app.main:app --reload --port 8000
# 前端本地运行: cd frontend && pnpm dev # http://localhost:5173 (proxy /api -> :8000)
# model_server: cd model_server && uv run uvicorn main:app --port 8100 (需 GPU/CUDA)
#
# 各服务端口均映射到 host,本地 backend 经 localhost 连接(见根 .env)。
# ===================================================================
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-coderag}
POSTGRES_USER: ${POSTGRES_USER:-coderag}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-coderag}
volumes:
- pg_data:/var/lib/postgresql/data
- ./docker/init-sql:/docker-entrypoint-initdb.d:ro
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-coderag} -d ${POSTGRES_DB:-coderag}"]
interval: 10s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis_data:/data
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 10
minio:
image: minio/minio:latest
restart: unless-stopped
command: ["server", "/data", "--console-address", ":9001"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-coderag}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-coderag123}
volumes:
- minio_data:/data
ports:
- "${MINIO_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 15s
timeout: 5s
retries: 10
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.0
restart: unless-stopped
environment:
discovery.type: single-node
xpack.security.enabled: "false"
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
volumes:
- es_data:/usr/share/elasticsearch/data
- ./docker/es/plugins:/usr/share/elasticsearch/plugins
ports:
- "${ES_PORT:-9200}:9200"
healthcheck:
test: ["CMD-SHELL", "curl -fs http://localhost:9200/_cluster/health || exit 1"]
interval: 15s
timeout: 5s
retries: 15
etcd:
# docker.io 上的 bitnami/etcd(可被国内镜像加速代理)
image: bitnami/etcd:3.5
restart: unless-stopped
environment:
ALLOW_NONE_AUTHENTICATION: "yes"
ETCD_AUTO_COMPACTION_MODE: revision
ETCD_AUTO_COMPACTION_RETENTION: "1000"
ETCD_QUOTA_BACKEND_BYTES: "4294967296"
volumes:
- etcd_data:/bitnami/etcd/data
healthcheck:
test: ["CMD", "etcdctl", "endpoint", "health"]
interval: 15s
timeout: 5s
retries: 10
milvus:
image: milvusdb/milvus:v2.4.10
restart: unless-stopped
command: ["milvus", "run", "standalone"]
security_opt:
- seccomp:unconfined
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
MINIO_ACCESS_KEY_ID: ${MINIO_ROOT_USER:-coderag}
MINIO_SECRET_ACCESS_KEY: ${MINIO_ROOT_PASSWORD:-coderag123}
MINIO_USE_SSL: "false"
volumes:
- milvus_data:/var/lib/milvus
ports:
- "${MILVUS_PORT:-19530}:19530"
- "${MILVUS_METRICS_PORT:-9091}:9091"
depends_on:
etcd:
condition: service_healthy
minio:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"]
interval: 20s
timeout: 5s
retries: 15
attu:
image: zilliz/attu:v2.3.10
restart: unless-stopped
environment:
MILVUS_URL: milvus:19530
ports:
- "${ATTU_PORT:-8001}:3000"
depends_on:
- milvus
volumes:
pg_data:
redis_data:
minio_data:
es_data:
etcd_data:
milvus_data: