mirror of
https://github.com/Yanyutin753/RefreshToV1Api.git
synced 2025-10-13 14:29:44 +00:00
23 lines
677 B
Docker
23 lines
677 B
Docker
# 使用官方 Python 运行时作为父镜像
|
|
FROM python:3.9-slim
|
|
|
|
# 设置工作目录为 /app
|
|
WORKDIR /app
|
|
|
|
# 将当前目录内容复制到位于 /app 的容器中
|
|
COPY . /app
|
|
|
|
# 设置环境变量
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
RUN chmod +x /app/main.py
|
|
|
|
# # 设置 pip 源为清华大学镜像
|
|
# RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
# 安装任何所需的依赖项
|
|
RUN pip install --no-cache-dir flask flask_apscheduler requests Pillow flask-cors tiktoken fake_useragent redis websocket-client pysocks requests[socks] websocket-client[optional]
|
|
|
|
# 在容器启动时运行 Flask 应用
|
|
CMD ["python3", "main.py"]
|