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

No files matched your search

+1 -3
View File
@@ -29,9 +29,7 @@ COPY --from=builder /usr/local/bin/ /usr/local/bin/
# 复制应用代码 # 复制应用代码
COPY . . COPY . .
# 创建media目录并设置权限 RUN chmod +x /app/entrypoint.sh
RUN mkdir -p /app/media \
&& chmod +x /app/entrypoint.sh
EXPOSE 8000 EXPOSE 8000
-4
View File
@@ -15,10 +15,6 @@ python manage.py collectstatic --noinput
# 计算worker数量 (CPU核心数 * 2 + 1) # 计算worker数量 (CPU核心数 * 2 + 1)
WORKERS=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count() * 2 + 1)') WORKERS=$(python -c 'import multiprocessing; print(multiprocessing.cpu_count() * 2 + 1)')
# 确保媒体目录存在并有正确的权限
echo "Setting up media directory..."
mkdir -p /app/media
# 启动 Gunicorn # 启动 Gunicorn
echo "Starting Gunicorn with $WORKERS workers..." echo "Starting Gunicorn with $WORKERS workers..."
exec gunicorn api.asgi:application \ exec gunicorn api.asgi:application \