orztv
commited on
Commit
·
1b6ef52
1
Parent(s):
da1bcc5
ok
Browse files- Dockerfile +3 -2
- run.sh +16 -8
Dockerfile
CHANGED
@@ -30,7 +30,7 @@ ENV WEBHOOK_URL=${WEBHOOK_URL} \
|
|
30 |
N8N_QUEUE_BULL_REDIS_PREFIX=n8n:queue \
|
31 |
EXECUTIONS_MODE=queue \
|
32 |
# 添加 Qdrant 配置
|
33 |
-
QDRANT_HOST=localhost \
|
34 |
QDRANT_PORT=6333 \
|
35 |
QDRANT_VERSION=1.12.4 \
|
36 |
# 添加超时配置
|
@@ -100,7 +100,8 @@ COPY --chown=pn:pn run.sh ./run.sh
|
|
100 |
COPY --chown=pn:pn config/n8n_env.sh ./config/n8n_env.sh
|
101 |
RUN chmod +x ./run.sh \
|
102 |
&& mkdir -p /home/pn/.n8n \
|
103 |
-
&& chown -R pn:pn /home/pn/.n8n
|
|
|
104 |
|
105 |
# 暴露端口
|
106 |
EXPOSE 7860
|
|
|
30 |
N8N_QUEUE_BULL_REDIS_PREFIX=n8n:queue \
|
31 |
EXECUTIONS_MODE=queue \
|
32 |
# 添加 Qdrant 配置
|
33 |
+
QDRANT_HOST=http://localhost \
|
34 |
QDRANT_PORT=6333 \
|
35 |
QDRANT_VERSION=1.12.4 \
|
36 |
# 添加超时配置
|
|
|
100 |
COPY --chown=pn:pn config/n8n_env.sh ./config/n8n_env.sh
|
101 |
RUN chmod +x ./run.sh \
|
102 |
&& mkdir -p /home/pn/.n8n \
|
103 |
+
&& chown -R pn:pn /home/pn/.n8n \
|
104 |
+
&& chown -R pn:pn /home/pn/n8n
|
105 |
|
106 |
# 暴露端口
|
107 |
EXPOSE 7860
|
run.sh
CHANGED
@@ -129,9 +129,6 @@ EOF
|
|
129 |
while [ $SECONDS -lt $end ]; do
|
130 |
if curl -s http://localhost:6333/health >/dev/null; then
|
131 |
echo "Qdrant server started successfully"
|
132 |
-
# 输出版本和状态信息
|
133 |
-
echo "Qdrant version:"
|
134 |
-
curl -s http://localhost:6333/version
|
135 |
|
136 |
# 预创建常用集合
|
137 |
echo "Creating default collections..."
|
@@ -142,16 +139,23 @@ EOF
|
|
142 |
-d '{
|
143 |
"vectors": {
|
144 |
"size": 768,
|
145 |
-
"distance": "Cosine"
|
|
|
146 |
},
|
147 |
"optimizers_config": {
|
148 |
"default_segment_number": 2,
|
149 |
-
"indexing_threshold": 20000
|
|
|
150 |
},
|
151 |
"hnsw_config": {
|
152 |
"m": 16,
|
153 |
"ef_construct": 100,
|
154 |
-
"full_scan_threshold": 10000
|
|
|
|
|
|
|
|
|
|
|
155 |
}
|
156 |
}'
|
157 |
|
@@ -193,9 +197,13 @@ EOF
|
|
193 |
}
|
194 |
}'
|
195 |
|
196 |
-
#
|
197 |
echo -e "\nVerifying collections:"
|
198 |
-
curl -s http://localhost:6333/collections
|
|
|
|
|
|
|
|
|
199 |
|
200 |
return 0
|
201 |
fi
|
|
|
129 |
while [ $SECONDS -lt $end ]; do
|
130 |
if curl -s http://localhost:6333/health >/dev/null; then
|
131 |
echo "Qdrant server started successfully"
|
|
|
|
|
|
|
132 |
|
133 |
# 预创建常用集合
|
134 |
echo "Creating default collections..."
|
|
|
139 |
-d '{
|
140 |
"vectors": {
|
141 |
"size": 768,
|
142 |
+
"distance": "Cosine",
|
143 |
+
"on_disk": true
|
144 |
},
|
145 |
"optimizers_config": {
|
146 |
"default_segment_number": 2,
|
147 |
+
"indexing_threshold": 20000,
|
148 |
+
"memmap_threshold": 10000
|
149 |
},
|
150 |
"hnsw_config": {
|
151 |
"m": 16,
|
152 |
"ef_construct": 100,
|
153 |
+
"full_scan_threshold": 10000,
|
154 |
+
"max_indexing_threads": 0,
|
155 |
+
"on_disk": true
|
156 |
+
},
|
157 |
+
"init_from": {
|
158 |
+
"collection_name": "text_vectors"
|
159 |
}
|
160 |
}'
|
161 |
|
|
|
197 |
}
|
198 |
}'
|
199 |
|
200 |
+
# 验证集合创建状态并输出详细信息
|
201 |
echo -e "\nVerifying collections:"
|
202 |
+
curl -s 'http://localhost:6333/collections' | jq '.'
|
203 |
+
|
204 |
+
# 测试连接
|
205 |
+
echo -e "\nTesting Qdrant connection:"
|
206 |
+
curl -v http://localhost:6333/health
|
207 |
|
208 |
return 0
|
209 |
fi
|