NopePrime commited on
Commit
e378c2d
·
verified ·
1 Parent(s): 378dfb9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -5,42 +5,39 @@ ENV DEBIAN_FRONTEND=noninteractive \
5
  PYTHONUNBUFFERED=1 \
6
  CONFIG_FILE=/app/conf.yaml
7
 
 
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  ffmpeg git git-lfs curl ca-certificates \
10
  nodejs npm \
11
  && rm -rf /var/lib/apt/lists/* && git lfs install
12
 
13
- # Cài đặt Node.js
14
- RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
15
- apt-get install -y nodejs
16
-
17
- # Cài đặt sẵn các MCP server phổ biến
18
- RUN npm install -g @modelcontextprotocol/server-time @modelcontextprotocol/server-fetch
19
 
20
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
21
 
22
  WORKDIR /app
23
 
24
- # 1. Copy local server code
25
  COPY . /app
26
  COPY mcp_servers.json /app/
27
  COPY local_tools.py /app/
28
 
29
- # 2. Create target directories
30
  RUN mkdir -p /app/frontend/live2d-models \
31
  /app/frontend/backgrounds \
32
  /app/frontend/music
33
 
34
- # 3. Clone Dataset and move files
35
  RUN git clone https://huggingface.co/datasets/NopePrime/Open-LLM-Dataset /tmp/assets && \
36
  cp -r /tmp/assets/live2d-models/* /app/frontend/live2d-models/ && \
37
  cp -r /tmp/assets/backgrounds/* /app/frontend/backgrounds/ && \
38
  cp -r /tmp/assets/music/* /app/frontend/music/ || true && \
39
  rm -rf /tmp/assets
40
 
41
- # ĐÃ XÓA DÒNG RUN echo "{}" TẠI ĐÂY
42
-
43
  RUN uv pip install --system .
 
 
44
  RUN useradd -m -u 1000 user || true && \
45
  chown -R user:user /app && \
46
  chmod -R 775 /app
 
5
  PYTHONUNBUFFERED=1 \
6
  CONFIG_FILE=/app/conf.yaml
7
 
8
+ # 1. Cài đặt các phụ thuộc hệ thống (Gộp Node.js vào đây để tối ưu)
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  ffmpeg git git-lfs curl ca-certificates \
11
  nodejs npm \
12
  && rm -rf /var/lib/apt/lists/* && git lfs install
13
 
14
+ # XÓA BỎ bước cài đặt Node Source 18.x và npm install -g vì gây lỗi build 404
15
+ # Hệ thống sẽ tự động dùng npx để chạy MCP servers lúc cần thiết.
 
 
 
 
16
 
17
  COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
18
 
19
  WORKDIR /app
20
 
21
+ # 2. Sao chép nguồn và cấu hình
22
  COPY . /app
23
  COPY mcp_servers.json /app/
24
  COPY local_tools.py /app/
25
 
26
+ # 3. Tạo thư mục và tải dữ liệu từ Hugging Face
27
  RUN mkdir -p /app/frontend/live2d-models \
28
  /app/frontend/backgrounds \
29
  /app/frontend/music
30
 
 
31
  RUN git clone https://huggingface.co/datasets/NopePrime/Open-LLM-Dataset /tmp/assets && \
32
  cp -r /tmp/assets/live2d-models/* /app/frontend/live2d-models/ && \
33
  cp -r /tmp/assets/backgrounds/* /app/frontend/backgrounds/ && \
34
  cp -r /tmp/assets/music/* /app/frontend/music/ || true && \
35
  rm -rf /tmp/assets
36
 
37
+ # 4. Cài đặt các thư viện Python
 
38
  RUN uv pip install --system .
39
+
40
+ # 5. Phân quyền người dùng
41
  RUN useradd -m -u 1000 user || true && \
42
  chown -R user:user /app && \
43
  chmod -R 775 /app