lightrag / Dockerfile
jun2024's picture
Update Dockerfile
930205a verified
Raw History Blame Contribute Delete
1.22 kB
# 使用 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"]