selenium_keyan/selenium_django/entrypoint.sh

15 lines
535 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# entrypoint.sh
# 启动 Celery 入队 Worker可以多线程
echo "Starting Celery crawler queue worker..."
celery -A selenium_django worker -Q crawler -l info --pool=threads -c 4 &
# 启动 Celery 爬虫处理 Worker顺序执行单线程
echo "Starting Celery crawl_worker (sequential)..."
celery -A selenium_django worker -Q crawl_worker -l info --pool=prefork -c 1 &
# 启动 Django Gunicorn
echo "Starting Django..."
exec gunicorn selenium_django.wsgi:application --log-level=info --bind 0.0.0.0:8000