test
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user