ACCA225 commited on
Commit
7d24efc
·
verified ·
1 Parent(s): 61e5352

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -9
Dockerfile CHANGED
@@ -36,17 +36,11 @@ RUN curl -sL https://deb.nodesource.com/setup_21.x | bash - && \
36
  apt-get install -y nodejs && \
37
  npm install -g configurable-http-proxy
38
 
39
- # --- 修改开始 ---
40
-
41
- # 设置工作目录为 /app
42
- WORKDIR /app
43
-
44
  # 设置 Conda 环境,并将其安装在 /opt/conda
45
  ENV CONDA_AUTO_UPDATE_CONDA=false \
46
  PATH=/opt/conda/bin:$PATH
47
  RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
48
  && chmod +x ~/miniconda.sh \
49
- # 将 -p 参数指向 /opt/conda
50
  && ~/miniconda.sh -b -p /opt/conda \
51
  && rm ~/miniconda.sh \
52
  && conda clean -ya
@@ -55,7 +49,6 @@ RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39
55
  ENV HOME=/root
56
  WORKDIR $HOME/app
57
 
58
- # 这部分保留,因为它是 root 用户执行的,没有变化
59
  # 安装用户定义的 Debian 包
60
  RUN --mount=target=/root/packages.txt,source=packages.txt \
61
  apt-get update && \
@@ -73,10 +66,13 @@ RUN mkdir /data
73
  RUN --mount=target=requirements.txt,source=requirements.txt \
74
  pip install --no-cache-dir --upgrade -r requirements.txt
75
 
76
- # 复制当前目录内容到容器中
 
77
  COPY . $HOME/app
78
 
79
- # 确保启动脚本有执行权限
 
 
80
  RUN chmod +x start_server.sh
81
 
82
  # 复制自定义登录页(注意路径已更改为新的 conda site-packages 路径)
 
36
  apt-get install -y nodejs && \
37
  npm install -g configurable-http-proxy
38
 
 
 
 
 
 
39
  # 设置 Conda 环境,并将其安装在 /opt/conda
40
  ENV CONDA_AUTO_UPDATE_CONDA=false \
41
  PATH=/opt/conda/bin:$PATH
42
  RUN curl -sLo ~/miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-py39_4.10.3-Linux-x86_64.sh \
43
  && chmod +x ~/miniconda.sh \
 
44
  && ~/miniconda.sh -b -p /opt/conda \
45
  && rm ~/miniconda.sh \
46
  && conda clean -ya
 
49
  ENV HOME=/root
50
  WORKDIR $HOME/app
51
 
 
52
  # 安装用户定义的 Debian 包
53
  RUN --mount=target=/root/packages.txt,source=packages.txt \
54
  apt-get update && \
 
66
  RUN --mount=target=requirements.txt,source=requirements.txt \
67
  pip install --no-cache-dir --upgrade -r requirements.txt
68
 
69
+ # 复制当前目录内容到容器中 (这里包含了 start_server.sh)
70
+ # --- 只保留这一次 COPY ---
71
  COPY . $HOME/app
72
 
73
+ # --- 关键修复步骤,紧跟在COPY之后 ---
74
+ # 为 start_server.sh 添加执行权限
75
+ # 因为 WORKDIR 已经是 $HOME/app,所以可以直接用相对路径
76
  RUN chmod +x start_server.sh
77
 
78
  # 复制自定义登录页(注意路径已更改为新的 conda site-packages 路径)