FROM python:3.11-slim WORKDIR /app # 安装依赖 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 复制代码 COPY . . # 收集静态文件 RUN python manage.py collectstatic --noinput EXPOSE 8087 CMD ["python", "manage.py", "runserver", "0.0.0.0:8087"]