This commit is contained in:
2025-06-15 22:32:59 +08:00
parent 3502ac0c42
commit 452b4039fe
2 changed files with 1 additions and 7 deletions

View File

@@ -29,9 +29,7 @@ COPY --from=builder /usr/local/bin/ /usr/local/bin/
# 复制应用代码
COPY . .
# 创建media目录并设置权限
RUN mkdir -p /app/media \
&& chmod +x /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
EXPOSE 8000

View File

@@ -15,10 +15,6 @@ python manage.py collectstatic --noinput
# 计算worker数量 (CPU核心数 * 2 + 1)
WORKERS=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count() * 2 + 1)')
# 确保媒体目录存在并有正确的权限
echo "Setting up media directory..."
mkdir -p /app/media
# 启动 Gunicorn
echo "Starting Gunicorn with $WORKERS workers..."
exec gunicorn api.asgi:application \