File size: 531 Bytes
6a58f05 |
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 |
# 使用官方 Python 3.11 slim 镜像作为基础镜像
FROM python:3.11-slim-buster
# 设置工作目录
WORKDIR /app
# 将 requirements.txt 文件复制到工作目录
COPY requirements.txt .
# 安装 requirements.txt 中指定的依赖
RUN pip install --no-cache-dir -r requirements.txt
# 将应用程序代码复制到工作目录
COPY . .
# 设置环境变量 (可选,但推荐)
ENV TARGET_DOMAIN="https://api.chatanywhere.tech"
ENV PORT=8000
# 暴露端口
EXPOSE 8000
# 定义启动命令
CMD ["python", "app.py"]
|