ai_admin/Dockerfile

24 lines
632 B
Docker
Raw Normal View History

2024-09-20 12:29:09 +08:00
# 使用 Python 3.11.0 作为基础镜像
FROM python:3.11.0
# 设置工作目录
WORKDIR /app
# 复制 requirements 文件以便安装依赖
COPY requirements.txt .
# 安装依赖
RUN pip install -r requirements.txt
# 安装 uwsgi 并检查是否成功安装
RUN pip install --no-cache-dir uwsgi
# 复制项目文件到工作目录
COPY . .
# 暴露应用的端口
EXPOSE 3001
# 使用 uWSGI 启动 Django 服务
CMD ["uwsgi", "--http", "0.0.0.0:3001", "--module", "WebSite.wsgi:application", "--master", "--processes", "4", "--threads", "2", "--harakiri", "20", "--max-requests", "5000", "--vacuum", "--touch-reload=/app"]