File size: 828 Bytes
b046893
8496edd
73574a2
 
b046893
81038f1
 
73574a2
 
 
 
 
81038f1
 
 
73574a2
b046893
8496edd
 
b046893
8496edd
81038f1
 
 
8496edd
b046893
8496edd
 
79f4ebb
97b5c54
b046893
 
79f4ebb
 
81038f1
3fedf34
 
73574a2
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
FROM python:3.11-slim

ENV DEBIAN_FRONTEND=noninteractive

# 安装依赖项
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    texlive-latex-base \
    texlive-fonts-recommended \
    texlive-latex-recommended \
    texlive-xetex \
    lmodern \
    curl \
    git \
    && apt-get clean && rm -rf /var/lib/apt/lists/*

# 添加用户
RUN useradd -m -u 1000 user

# 设置环境变量
ENV HOME=/home/user \
    PATH="/home/user/.local/bin:$PATH"

USER user

# 拷贝应用文件并安装依赖
COPY --chown=user . $HOME/app

WORKDIR $HOME/app/hf_app

RUN pip install --no-cache-dir --upgrade pip \
 && pip install --no-cache-dir streamlit \
 && pip install --no-cache-dir -r ../requirements.txt



 # 运行 Streamlit 应用
CMD ["streamlit", "run", "app.py", "--server.port", "8200"]