innofacisteven commited on
Commit
fae2bba
·
verified ·
1 Parent(s): 762dd1b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -11
Dockerfile CHANGED
@@ -4,25 +4,25 @@ FROM ghcr.io/hkuds/lightrag:latest
4
  USER root
5
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
- curl \
8
- ca-certificates \
9
- zstd \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
- # 安裝 Ollama(官方安裝腳本)
13
- RUN curl -fsSL https://ollama.com/install.sh | sh
 
 
14
 
15
  # 切回原本的非 root 使用者(lightrag 映像通常用非 root)
16
  USER 1000
17
 
18
  WORKDIR /app
19
 
20
- # 複製啟動腳本
21
- COPY start.sh /app/start.sh
22
- RUN chmod +x /app/start.sh
23
 
24
- # 複製 .env(重要!讓 LightRAG 能讀到)
25
- COPY .env /app/.env
26
 
27
  EXPOSE 9621
28
 
 
4
  USER root
5
 
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
+ curl ca-certificates zstd \
8
+ && rm -rf /var/lib/apt/lists/* \
9
+ && curl -fsSL https://ollama.com/install.sh | sh
 
10
 
11
+ # 建立 Ollama 需要的目錄並給予正確權限
12
+ RUN mkdir -p /.ollama /app && \
13
+ chown -R 1000:1000 /.ollama /app && \
14
+ chmod -R 755 /.ollama
15
 
16
  # 切回原本的非 root 使用者(lightrag 映像通常用非 root)
17
  USER 1000
18
 
19
  WORKDIR /app
20
 
21
+ # 複製檔案並確保權限
22
+ COPY --chown=1000:1000 start.sh /app/start.sh
23
+ COPY --chown=1000:1000 .env /app/.env
24
 
25
+ RUN chmod +x /app/start.sh
 
26
 
27
  EXPOSE 9621
28