You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
607 B
Docker
21 lines
607 B
Docker
# 使用官方 Python 基础镜像
|
|
FROM hub.1panel.dev/library/python:3.12-slim
|
|
|
|
# RUN apt-get update && apt-get install -y gcc && rm -rf /var/lib/apt/lists/*
|
|
|
|
# 设置工作目录
|
|
WORKDIR /app
|
|
|
|
# 将当前目录下的所有文件复制到容器中的 /app 目录
|
|
COPY . /app
|
|
|
|
# 安装依赖
|
|
#RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
|
|
RUN pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ -r requirements.txt
|
|
|
|
|
|
# 暴露应用程序运行的端口(如果需要)
|
|
EXPOSE 8000
|
|
|
|
# 启动命令
|
|
CMD ["python", "backend.py","--env=prod"] |