Update Dockerfile
Browse files- Dockerfile +0 -35
Dockerfile
CHANGED
@@ -27,41 +27,6 @@ RUN mkdir -p /app/lightrag_storage/fire_safety && \
|
|
27 |
chown -R root:root /app/lightrag_storage && \
|
28 |
chown -R root:root /app/user_data
|
29 |
|
30 |
-
# Pre-process knowledge files if they exist
|
31 |
-
RUN if [ -f "/app/book.txt" ] || [ -f "/app/book.pdf" ]; then \
|
32 |
-
echo "Found knowledge files, pre-processing..."; \
|
33 |
-
python -c "
|
34 |
-
import asyncio
|
35 |
-
import sys
|
36 |
-
import os
|
37 |
-
sys.path.append('/app')
|
38 |
-
from lightrag_manager import CloudflareWorker, LightRAGManager
|
39 |
-
|
40 |
-
# Dummy worker for build time
|
41 |
-
class DummyWorker:
|
42 |
-
def __init__(self):
|
43 |
-
self.llm_model_name = 'dummy'
|
44 |
-
async def query(self, prompt, system_prompt='', **kwargs):
|
45 |
-
return 'Build time response'
|
46 |
-
async def embedding_chunk(self, texts):
|
47 |
-
import numpy as np
|
48 |
-
return np.random.rand(len(texts), 1024)
|
49 |
-
|
50 |
-
async def prebuild_knowledge():
|
51 |
-
try:
|
52 |
-
worker = DummyWorker()
|
53 |
-
manager = LightRAGManager(worker)
|
54 |
-
await manager.initialize_fire_safety_rag()
|
55 |
-
print('Knowledge pre-processed successfully')
|
56 |
-
except Exception as e:
|
57 |
-
print(f'Pre-processing failed: {e}')
|
58 |
-
|
59 |
-
asyncio.run(prebuild_knowledge())
|
60 |
-
"; \
|
61 |
-
else \
|
62 |
-
echo "No knowledge files found, skipping pre-processing"; \
|
63 |
-
fi
|
64 |
-
|
65 |
# Set environment variables
|
66 |
ENV PYTHONPATH=/app
|
67 |
ENV PYTHONUNBUFFERED=1
|
|
|
27 |
chown -R root:root /app/lightrag_storage && \
|
28 |
chown -R root:root /app/user_data
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
# Set environment variables
|
31 |
ENV PYTHONPATH=/app
|
32 |
ENV PYTHONUNBUFFERED=1
|