first commit
This commit is contained in:
23
Dockerfile
Executable file
23
Dockerfile
Executable file
@@ -0,0 +1,23 @@
|
||||
# 使用 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"]
|
||||
Reference in New Issue
Block a user