File size: 553 Bytes
deb4e3b f38da43 deb4e3b f38da43 deb4e3b f38da43 deb4e3b f38da43 deb4e3b f38da43 deb4e3b |
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 |
# 使用官方 Python 镜像作为基础镜像
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件到容器中
COPY . /app
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
# 暴露端口(如果您的应用需要的话)
# EXPOSE 8000
# 运行应用
CMD ["python", "main.py"] |