leonsimon23 commited on
Commit
8a9542e
·
verified ·
1 Parent(s): 307d7bd

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -6
Dockerfile CHANGED
@@ -10,7 +10,9 @@ COPY app.R .
10
  COPY gmqrkl.xlsx .
11
 
12
  # 确保系统包更新和安装必要的开发工具(对于 R 包编译可能需要)
13
- RUN apt-get update && apt-get install -y \
 
 
14
  sudo \
15
  curl \
16
  libxml2-dev \
@@ -29,16 +31,17 @@ RUN apt-get update && apt-get install -y \
29
  python3-pip \
30
  python3-dev \
31
  build-essential \
 
 
 
32
  python3-venv \
33
  python3-wheel \
34
  && rm -rf /var/lib/apt/lists/*
35
 
36
- # 升级 pip 并为 prophet 包安装 Python 依赖
37
  # 注意:Prophet R 包在内部调用了 Python 的 Prophet 库
38
- # 我们将 pystan fbprophet 分开安装,并尝试指定一个稳定版本
39
- # 例如,fbprophet 0.7.1 是一个广泛使用的稳定版本,它通常与 pystan < 2.0 兼容
40
- # 尝试使用 --break-system-packages 解决 pip 自身升级的问题
41
- RUN pip3 install --upgrade pip --break-system-packages
42
  RUN pip3 install pystan==2.19.1.1 # Pin a specific stable pystan version
43
  RUN pip3 install fbprophet==0.7.1 # Pin a specific stable fbprophet version
44
 
 
10
  COPY gmqrkl.xlsx .
11
 
12
  # 确保系统包更新和安装必要的开发工具(对于 R 包编译可能需要)
13
+ # IMPORTANT: Added libpython3-dev for robust Python C-extensions compilation
14
+ # Also added build-essential and gfortran which are crucial for pystan/fbprophet
15
+ RUN apt-get update && apt-get install -y --no-install-recommends \
16
  sudo \
17
  curl \
18
  libxml2-dev \
 
31
  python3-pip \
32
  python3-dev \
33
  build-essential \
34
+ # Ensure python development headers are explicitly there
35
+ libpython3-dev \
36
+ # Added python3-venv and python3-wheel as good practices
37
  python3-venv \
38
  python3-wheel \
39
  && rm -rf /var/lib/apt/lists/*
40
 
41
+ # prophet 包安装 Python 依赖
42
  # 注意:Prophet R 包在内部调用了 Python 的 Prophet 库
43
+ # 移除了 pip 自身升级的步骤,因为 apt 管理的 pip 不应由 pip 自身升级
44
+ # 再次尝试安装 pystan fbprophet,确保所有依赖到位
 
 
45
  RUN pip3 install pystan==2.19.1.1 # Pin a specific stable pystan version
46
  RUN pip3 install fbprophet==0.7.1 # Pin a specific stable fbprophet version
47