seaislee1209 2e72c82116
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m39s
Merge branch 'dev' of https://gitea.airlabs.art/zyc/video-shuoshan into dev
2026-04-04 17:36:39 +08:00

34 lines
1.0 KiB
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", "--worker-class", "gevent", "--worker-connections", "200", "--timeout", "120", "--access-logfile", "-", "--error-logfile", "-", "config.wsgi:application"]