Skip to content

Commit

Permalink
Add basic celery configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Sygnator committed Apr 11, 2024
1 parent cd31e4f commit 5b6f7c3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ COPY . ./
RUN python ./manage.py collectstatic --noinput

ENTRYPOINT ["uvicorn", "api.asgi:application", "--host", "0.0.0.0"]

RUN pip install celery

CMD celery -A czatknml.celery worker -l info
3 changes: 3 additions & 0 deletions api/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .celery import app as celery_app

__all__ = ("celery_app",)
7 changes: 7 additions & 0 deletions api/api/celery.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import os
from celery import Celery

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django_celery.settings")
app = Celery("chatknml")
app.config_from_object("django.conf:settings", namespace="CELERY")
app.autodiscover_tasks()

0 comments on commit 5b6f7c3

Please sign in to comment.