对齐火山 API 文档(Asset URI 小写、HEIC/HEIF、DeleteAsset) 素材库支持视频/音频上传(按类型分三区显示、前端校验、拖拽上传) @ 引用从素材组改为单个素材(搜索返回具体素材、即时数量/时长检查) ffmpeg 视频封面帧提取 + 音频时长读取(Celery 异步) 生产级安全修复(跨团队校验、异常信息脱敏、下载大小限制)
34 lines
973 B
Docker
34 lines
973 B
Docker
FROM docker.m.daocloud.io/python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
# System dependencies (Aliyun mirror for China)
|
|
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources && \
|
|
apt-get update && apt-get install -y \
|
|
gcc \
|
|
default-libmysqlclient-dev \
|
|
pkg-config \
|
|
ffmpeg \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Python dependencies
|
|
COPY requirements.txt /app/
|
|
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
|
|
pip install --upgrade pip && pip install -r requirements.txt
|
|
|
|
COPY . /app/
|
|
|
|
# Collect static files
|
|
RUN python manage.py collectstatic --noinput 2>/dev/null || true
|
|
|
|
# Make entrypoint executable
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
EXPOSE 8000
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "--workers", "2", "--timeout", "120", "--access-logfile", "-", "--error-logfile", "-", "config.wsgi:application"]
|