feat: enable scheduler execution in Docker by checking UVICORN_MAIN environment variable

This commit is contained in:
ramvignesh-b
2026-04-29 02:20:18 +05:30
parent 4893c91c20
commit 150832419a
2 changed files with 8 additions and 3 deletions
+2 -1
View File
@@ -12,4 +12,5 @@ COPY . .
EXPOSE 8000
CMD ["sh", "-c", "uv run manage.py migrate && uv run gunicorn --bind 0.0.0.0:8000 --access-logfile - --error-logfile - --capture-output --log-level debug config.wsgi:application"]
# NOTE: Exporting env var 'UVICORN_MAIN=true' is required for the scheduler to run on app start.
CMD ["sh", "-c", "uv run manage.py migrate && UVICORN_MAIN=true uv run gunicorn --bind 0.0.0.0:8000 --access-logfile - --error-logfile - --capture-output --log-level debug config.wsgi:application"]