File size: 1,324 Bytes
b475683
 
4d5692f
 
 
b475683
4d5692f
e3fe05d
4d5692f
 
 
e3fe05d
 
 
4d5692f
b475683
4d5692f
 
 
b475683
4d5692f
 
 
 
 
 
 
 
 
 
b475683
4d5692f
 
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
FROM python:3.11-slim

ENV PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    PIP_NO_CACHE_DIR=1

# Node.js 22(給 npx 類 MCP 伺服器 / 技能腳本)+ 常用工具
# LibreOffice 用來預覽 / 轉換 Office 文件;其他是開發常用工具
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates git gnupg \
 && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
 && apt-get install -y --no-install-recommends nodejs \
    build-essential pkg-config ffmpeg poppler-utils jq ripgrep sqlite3 zip unzip less procps \
    libreoffice-writer-nogui libreoffice-calc-nogui libreoffice-impress-nogui \
    fonts-noto-cjk fonts-noto-color-emoji fonts-dejavu \
 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /tmp/requirements.txt
# uv 提供 uvx(給 Python 類 MCP 伺服器)
RUN pip install --upgrade pip && pip install -r /tmp/requirements.txt uv

# HF Spaces 以 uid 1000 執行
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    NPM_CONFIG_CACHE=/home/user/.npm \
    WORKDIR=/home/user/workspace \
    SKILLS_DIR=/home/user/skills
WORKDIR /home/user/app
COPY --chown=user . .

EXPOSE 7860
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*"]