develop
Сергей Ванюшкин 2024-02-12 01:29:06 +03:00
parent e6576e9e58
commit 47cb0e08c7
2 changed files with 24 additions and 7 deletions

View File

@ -62,8 +62,8 @@ services:
command: /bin/bash -c 'poetry run python /usr/src/fastfood/manage.py --run-docker-server' command: /bin/bash -c 'poetry run python /usr/src/fastfood/manage.py --run-docker-server'
celery: celery_worker:
container_name: celery container_name: celeryworker
build: build:
context: . context: .
@ -80,7 +80,28 @@ services:
volumes: volumes:
- .:/usr/src/fastfood - .:/usr/src/fastfood
command: /bin/bash -c 'poetry run python /usr/src/fastfood/manage.py --run-selery' command: ["celery", "-A", "bg_tasks.bg_task:celery_app", "worker", "--loglevel=info", "--concurrency", "1", "-P", "solo"]
celery_beat:
container_name: celerybeat
build:
context: .
env_file:
- .env
depends_on:
- rabbitmq
- db
- app
- redis
volumes:
- .:/usr/src/fastfood
command: ["celery", "-A", "bg_tasks.bg_task:celery_app", "beat", "--loglevel=info"]
rabbitmq: rabbitmq:
container_name: rabbit container_name: rabbit

View File

@ -42,10 +42,6 @@ async def recreate() -> None:
if __name__ == '__main__': if __name__ == '__main__':
if '--run-celery' in sys.argv:
celery_worker_process.start()
celery_beat_process.start()
if '--run-docker-server' in sys.argv: if '--run-docker-server' in sys.argv:
loop.run_until_complete(recreate()) loop.run_until_complete(recreate())
loop.run_until_complete(run_app()) loop.run_until_complete(run_app())