File size: 1,216 Bytes
234e63a
56035c2
 
2e0284f
ff13778
234e63a
ff13778
56035c2
 
ff13778
309117a
cd6227f
ff13778
 
 
 
309117a
ff13778
 
234e63a
cd6227f
 
930205a
 
 
 
cd6227f
72905bd
 
 
234e63a
a741f65
234e63a
ff13778
 
234e63a
2e0284f
 
 
 
ff13778
cd6227f
234e63a
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
# 使用 LightRAG 官方镜像
FROM ghcr.io/hkuds/lightrag:latest

USER root

# 安装基础工具
RUN apt-get update && apt-get install -y curl ca-certificates && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# 设置必须的固定环境变量
# 采用“多重保险”写法,同时兼容新旧版本变量名
ENV WORKING_DIR=/app/rag_storage \
    PORT=9621 \
    LLM_BINDING=openai \
    EMBEDDING_BINDING=openai \
    WORKSPACE=default \
    POSTGRES_PORT=5432 \
    POSTGRES_USER=postgres \
    POSTGRES_DATABASE=postgres \
    # --- 存储引擎配置 (多重保险) ---
    # 旧版/带前缀变量名
    LIGHTRAG_KV_STORAGE=PGKVStorage \
    LIGHTRAG_VECTOR_STORAGE=PGVectorStorage \
    LIGHTRAG_GRAPH_STORAGE=PGGraphStorage \
    LIGHTRAG_DOC_STATUS_STORAGE=PGDocStatusStorage \
    # 新版/标准变量名
    KV_STORAGE=PGKVStorage \
    DOC_STATUS_STORAGE=PGDocStatusStorage \
    GRAPH_STORAGE=PGGraphStorage \
    VECTOR_STORAGE=PGVectorStorage

# 确保工作目录权限
RUN mkdir -p /app/rag_storage && chmod -R 777 /app

# 拷贝并授权启动脚本
COPY start.sh /app/start.sh
RUN chmod +x /app/start.sh

EXPOSE 9621

# 使用标准 bash 运行脚本
ENTRYPOINT ["/bin/bash", "/app/start.sh"]