File tree Expand file tree Collapse file tree 1 file changed +13
-20
lines changed Expand file tree Collapse file tree 1 file changed +13
-20
lines changed Original file line number Diff line number Diff line change 1
- # Use the official Ubuntu base image
2
- FROM ubuntu:22.04
1
+ # 使用官方 Python 3.11 的轻量版镜像
2
+ FROM python:3.11-slim
3
+
3
4
LABEL maintainer="Evil0ctal"
4
5
5
- # Set non-interactive frontend (useful for Docker builds)
6
+ # 设置非交互模式,避免 Docker 构建时的交互问题
6
7
ENV DEBIAN_FRONTEND=noninteractive
7
8
8
- # Update the package list and install Python and pip
9
- RUN apt-get update && apt-get install -y --no-install-recommends \
10
- python3.11 python3-pip \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Upgrade pip to the latest version
14
- RUN pip3 install -U pip
15
-
16
- # Set a working directory
9
+ # 设置工作目录
17
10
WORKDIR /app
18
11
19
- # Copy the application source code to the container
12
+ # 复制应用代码到容器
20
13
COPY . /app
21
14
22
- # Install pip and set the PyPI mirror (Aliyun)
23
- RUN pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
24
- && pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
15
+ # 使用 Aliyun 镜像源加速 pip
16
+ RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
17
+ && pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
25
18
26
- # Install dependencies directly
27
- RUN pip3 install --no-cache-dir -r requirements.txt
19
+ # 安装依赖
20
+ RUN pip install --no-cache-dir -r requirements.txt
28
21
29
- # Make the start script executable
22
+ # 确保启动脚本可执行
30
23
RUN chmod +x start.sh
31
24
32
- # Command to run on container start
25
+ # 设置容器启动命令
33
26
CMD ["./start.sh" ]
You can’t perform that action at this time.
0 commit comments