Files

21 lines
414 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 纯后端Docker镜像前端单独部署
FROM python:3.11-slim
WORKDIR /app
# 复制后端文件
COPY . .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir gunicorn
# 创建持久化数据目录
RUN mkdir -p /app/data
# 暴露端口
EXPOSE 7878
# 启动服务使用gunicorn
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7878", "app:app"]