fengmiguoji commited on
Commit
2fa8ef7
·
verified ·
1 Parent(s): 8176e9d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -4
Dockerfile CHANGED
@@ -19,15 +19,18 @@ WORKDIR /app
19
  # Copy the application source code to the container
20
  COPY . /app
21
 
22
- # 可以直接给 /app 目录加权限
23
- RUN chmod -R 777 /app
24
 
25
- # 安装 pip, 设置镜像, 安装依赖
26
  RUN pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
27
  && pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
 
 
28
  RUN pip3 install --no-cache-dir -r requirements.txt
29
 
30
- # Make the start script executable (如果有这个文件)
31
  RUN chmod +x start.sh
32
 
 
33
  CMD ["./start.sh"]
 
19
  # Copy the application source code to the container
20
  COPY . /app
21
 
22
+ # (可选)创建 logs 目录并赋予写权限(如果你的项目需要写日志)
23
+ RUN mkdir -p /app/logs && chmod 777 /app/logs
24
 
25
+ # Install pip and set the PyPI mirror (Aliyun)
26
  RUN pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
27
  && pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
28
+
29
+ # Install dependencies directly
30
  RUN pip3 install --no-cache-dir -r requirements.txt
31
 
32
+ # Make the start script executable (如果你的项目使用这个脚本来启动)
33
  RUN chmod +x start.sh
34
 
35
+ # Command to run on container start
36
  CMD ["./start.sh"]