This commit is contained in:
26
backend/Dockerfile
Normal file
26
backend/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# 使用 Python 3.13 slim 镜像作为基础镜像
|
||||
FROM python:3.13-slim
|
||||
|
||||
# 设置环境变量
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /app
|
||||
|
||||
# 安装 python 依赖
|
||||
COPY requirements.txt /app/
|
||||
RUN pip install --upgrade pip && pip install -r requirements.txt
|
||||
|
||||
# 复制项目
|
||||
COPY . /app/
|
||||
COPY .env /app/
|
||||
|
||||
# 暴露端口
|
||||
EXPOSE 8876
|
||||
|
||||
# Volume for media files
|
||||
VOLUME ["/app/media"]
|
||||
|
||||
# 启动命令
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8876", "config.wsgi:application"]
|
||||
Reference in New Issue
Block a user