Skip to content

Commit

Permalink
Fix Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Evil0ctal committed Feb 15, 2025
1 parent be7752a commit b438d69
Showing 1 changed file with 13 additions and 20 deletions.
33 changes: 13 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,26 @@
# Use the official Ubuntu base image
FROM ubuntu:22.04
# 使用官方 Python 3.11 的轻量版镜像
FROM python:3.11-slim

LABEL maintainer="Evil0ctal"

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

# Update the package list and install Python and pip
RUN apt-get update && apt-get install -y --no-install-recommends \
python3.11 python3-pip \
&& rm -rf /var/lib/apt/lists/*

# Upgrade pip to the latest version
RUN pip3 install -U pip

# Set a working directory
# 设置工作目录
WORKDIR /app

# Copy the application source code to the container
# 复制应用代码到容器
COPY . /app

# Install pip and set the PyPI mirror (Aliyun)
RUN pip3 install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
&& pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
# 使用 Aliyun 镜像源加速 pip
RUN pip install -i https://mirrors.aliyun.com/pypi/simple/ -U pip \
&& pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/

# Install dependencies directly
RUN pip3 install --no-cache-dir -r requirements.txt
# 安装依赖
RUN pip install --no-cache-dir -r requirements.txt

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

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

0 comments on commit b438d69

Please sign in to comment.