diff --git a/app/migrate_and_run.sh b/app/migrate_and_run.sh index 072dad9..9767477 100755 --- a/app/migrate_and_run.sh +++ b/app/migrate_and_run.sh @@ -8,4 +8,4 @@ do sleep 1 done -uwsgi --chmod-socket=666 -s /tmp/uwsgi/uwsgi.sock --plugin python3 --manage-script-name --mount /=autoapp:app +uwsgi --chmod-socket=666 -s /tmp/uwsgi/uwsgi.sock --plugin python3 --manage-script-name --mount /=autoapp:flaskapp diff --git a/app/requirements/prod.txt b/app/requirements/prod.txt index 50eb636..5300a20 100644 --- a/app/requirements/prod.txt +++ b/app/requirements/prod.txt @@ -40,3 +40,13 @@ Flask-DebugToolbar==0.10.1 # Requests requests==2.18.4 + +# Queue +celery==4.1.0 +flask-celeryext==0.3.0 + +# Cache +redis==2.10.6 + +# BeautifulSoup +beautifulsoup4==4.6.0 diff --git a/docker-compose.yml b/docker-compose.yml index ae29ea7..dd58767 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: - SERVER_NAME depends_on: - db + - queue webserver: build: ./webserver @@ -37,6 +38,54 @@ services: volumes: - db_data:/var/lib/league/db + queue: + image: rabbitmq:3.6.12 + + cache: + image: redis:3.2.11-alpine + + worker_1: + build: ./app + command: celery -A autoapp worker -l DEBUG + depends_on: + - db + - queue + - cache + environment: + - POSTGRES_DB + - POSTGRES_USER + - POSTGRES_PASSWORD + - LEAGUE_ROOT_PASS + - SLACK_CHANNEL + - SLACK_WEBHOOK + - SERVER_NAME + + worker_2: + build: ./app + command: celery -A autoapp worker -l DEBUG + depends_on: + - db + - queue + - cache + environment: + - POSTGRES_DB + - POSTGRES_USER + - POSTGRES_PASSWORD + - LEAGUE_ROOT_PASS + - SLACK_CHANNEL + - SLACK_WEBHOOK + - SERVER_NAME + + queue_monitor: + environment: + - CELERY_BROKER_URL + image: mher/flower + depends_on: + - queue + - cache + ports: + - '5555:5555' + volumes: uwsgi: db_data: