Skip to content

Commit b438d69

Browse files
committed
Fix Dockerfile
1 parent be7752a commit b438d69

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

Dockerfile

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
1-
# Use the official Ubuntu base image
2-
FROM ubuntu:22.04
1+
# 使用官方 Python 3.11 的轻量版镜像
2+
FROM python:3.11-slim
3+
34
LABEL maintainer="Evil0ctal"
45

5-
# Set non-interactive frontend (useful for Docker builds)
6+
# 设置非交互模式,避免 Docker 构建时的交互问题
67
ENV DEBIAN_FRONTEND=noninteractive
78

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+
# 设置工作目录
1710
WORKDIR /app
1811

19-
# Copy the application source code to the container
12+
# 复制应用代码到容器
2013
COPY . /app
2114

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/
2518

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
2821

29-
# Make the start script executable
22+
# 确保启动脚本可执行
3023
RUN chmod +x start.sh
3124

32-
# Command to run on container start
25+
# 设置容器启动命令
3326
CMD ["./start.sh"]

0 commit comments

Comments
 (0)