add celery background tasks and redis server for celery, also modify django to use redis instead of postgres for caching for speed improvement and alleviating sql traffic

This commit is contained in:
badblocks 2025-05-19 18:23:19 -07:00
parent eeae7ae675
commit f530790f6c
9 changed files with 313 additions and 32 deletions

View file

@ -16,6 +16,22 @@ services:
- PUBLIC_HOST=localhost
- ALLOWED_HOSTS=127.0.0.1,localhost
- DISABLE_CACHE=false
celery:
build: .
command: ["celery", "-A", "pkmntrade_club.django_project", "worker", "-l", "INFO", "-B", "-E"]
restart: always
env_file:
- .env
environment:
- DEBUG=true
- PUBLIC_HOST=localhost
- ALLOWED_HOSTS=127.0.0.1,localhost
- DISABLE_CACHE=false
redis:
image: redis:latest
restart: always
ports:
- 6379:6379
# depends_on:
# db:
# condition: service_healthy