File size: 1,099 Bytes
cb329ef
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2fa8ef7
 
e1799b8
2fa8ef7
cb329ef
 
2fa8ef7
 
cb329ef
 
2fa8ef7
cb329ef
 
2fa8ef7
8176e9d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Use the official Ubuntu base image
FROM ubuntu:jammy
LABEL maintainer="Evil0ctal"

# Set non-interactive frontend (useful for Docker builds)
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 \
    python3.11-dev \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/*

# Set a working directory
WORKDIR /app

# Copy the application source code to the container
COPY . /app

# (可选)创建 logs 目录并赋予写权限(如果你的项目需要写日志)
RUN mkdir -p /app/logs && chmod 777 /app/logs

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

# Install dependencies directly
RUN pip3 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"]