MathematicalModelingAgent commited on
Commit
b046893
·
1 Parent(s): 81038f1

update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -8
Dockerfile CHANGED
@@ -1,8 +1,8 @@
1
- FROM python:3.11
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
- # Install system dependencies
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  texlive-latex-base \
@@ -14,22 +14,22 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
14
  git \
15
  && apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
- # Create non-root user
18
  RUN useradd -m -u 1000 user
19
 
20
- # Set environment variables
21
  ENV HOME=/home/user \
22
  PATH="/home/user/.local/bin:$PATH"
23
 
24
  USER user
25
-
26
- # Set working directories
27
  WORKDIR $HOME/app
28
 
29
- # Copy app files and install Python requirements
30
  COPY --chown=user . $HOME/app
31
 
32
- RUN python3 -m pip install --no-cache-dir --upgrade pip \
 
33
  && pip install --no-cache-dir -r requirements.txt
34
 
 
35
  CMD ["streamlit", "run", "app.py", "--server.port", "8200"]
 
1
+ FROM python:3.11-slim
2
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
 
5
+ # 安装依赖项
6
  RUN apt-get update && apt-get install -y --no-install-recommends \
7
  build-essential \
8
  texlive-latex-base \
 
14
  git \
15
  && apt-get clean && rm -rf /var/lib/apt/lists/*
16
 
17
+ # 添加用户
18
  RUN useradd -m -u 1000 user
19
 
20
+ # 设置环境变量
21
  ENV HOME=/home/user \
22
  PATH="/home/user/.local/bin:$PATH"
23
 
24
  USER user
 
 
25
  WORKDIR $HOME/app
26
 
27
+ # 拷贝应用文件并安装依赖
28
  COPY --chown=user . $HOME/app
29
 
30
+ RUN pip install --no-cache-dir --upgrade pip \
31
+ && pip install --no-cache-dir streamlit \
32
  && pip install --no-cache-dir -r requirements.txt
33
 
34
+ # 运行 Streamlit 应用
35
  CMD ["streamlit", "run", "app.py", "--server.port", "8200"]