-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
162 lines (150 loc) · 3.36 KB
/
Copy pathdocker-compose.yml
File metadata and controls
162 lines (150 loc) · 3.36 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
version: "3.8"
services:
# === 后端服务 ===
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "8000:8000"
env_file:
- ./backend/.env
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
neo4j:
condition: service_started
milvus:
condition: service_started
volumes:
- ./backend:/app
- backend_media:/app/media
networks:
- learning-net
# === 前端服务 ===
frontend:
image: node:20-alpine
working_dir: /app
ports:
- "3000:3000"
volumes:
- ./frontend:/app
command: sh -c "npm install && npm run dev"
environment:
- NEXT_PUBLIC_API_URL=http://localhost:8000/api/v1
depends_on:
- backend
networks:
- learning-net
# === PostgreSQL ===
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: learning_system
POSTGRES_USER: user
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/scripts/init_db.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d learning_system"]
interval: 5s
timeout: 5s
retries: 5
networks:
- learning-net
# === Redis ===
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
networks:
- learning-net
# === Neo4j (知识图谱) ===
neo4j:
image: neo4j:5-community
environment:
NEO4J_AUTH: neo4j/password
NEO4J_PLUGINS: '["apoc"]'
ports:
- "7474:7474" # HTTP
- "7687:7687" # Bolt
volumes:
- neo4j_data:/data
networks:
- learning-net
# === Milvus (向量数据库) ===
milvus:
image: milvusdb/milvus:2.3-latest
ports:
- "19530:19530"
environment:
ETCD_ENDPOINTS: etcd:2379
MINIO_ADDRESS: minio:9000
depends_on:
- etcd
- minio
networks:
- learning-net
etcd:
image: quay.io/coreos/etcd:v3.5.5
environment:
ETCD_AUTO_COMPACTION_MODE: revision
ETCD_AUTO_COMPACTION_RETENTION: "1000"
ETCD_QUOTA_BACKEND_BYTES: "4294967296"
ETCD_SNAPSHOT_COUNT: "50000"
command: etcd --advertise-client-urls http://0.0.0.0:2379 --listen-client-urls http://0.0.0.0:2379 --data-dir /etcd
networks:
- learning-net
minio:
image: minio/minio:latest
ports:
- "9000:9000"
- "9001:9001"
command: minio server /data --console-address ":9001"
volumes:
- minio_data:/data
networks:
- learning-net
# === RabbitMQ ===
rabbitmq:
image: rabbitmq:3.12-management
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: password
networks:
- learning-net
# === Nginx ===
nginx:
image: nginx:1.24-alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/ssl:/etc/nginx/ssl:ro
depends_on:
- backend
- frontend
networks:
- learning-net
volumes:
postgres_data:
neo4j_data:
minio_data:
backend_media:
networks:
learning-net:
driver: bridge