add docker
This commit is contained in:
22
Dockerfile
Normal file
22
Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
||||
# 使用官方 Python 镜像作为基础
|
||||
FROM python:3.12-slim
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 将你的项目文件复制到工作目录
|
||||
COPY . .
|
||||
|
||||
# 安装依赖
|
||||
# --no-cache-dir: 不存储缓存,保持镜像小巧
|
||||
# --upgrade pip: 升级 pip
|
||||
# -r requirements.txt: 从文件安装
|
||||
RUN pip install --no-cache-dir --upgrade pip -r requirements.txt
|
||||
|
||||
RUN chmod +x /app/start.sh
|
||||
|
||||
# 暴露 Gunicorn 运行的端口
|
||||
EXPOSE 8000
|
||||
|
||||
# 容器启动时运行的命令
|
||||
CMD ["/app/start.sh"]
|
||||
Reference in New Issue
Block a user