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

@ -1,17 +1,20 @@
x-common: &common
restart: always
env_file:
- .env
environment:
- DEBUG=False
- DISABLE_SIGNUPS=True
- PUBLIC_HOST=pkmntrade.club
- ALLOWED_HOSTS=pkmntrade.club,127.0.0.1
services:
web:
<<: *common
image: ghcr.io/xe/x/httpdebug
entrypoint: ["/ko-app/httpdebug", "--bind", ":8000"]
#image: badbl0cks/pkmntrade-club:stable
#command: ["granian", "--interface", "wsgi", "pkmntrade_club.django_project.wsgi:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1", "--workers-kill-timeout", "180", "--access-log"]
# env_file:
# - .env
# environment:
# - DEBUG=False
# - DISABLE_SIGNUPS=True
# - PUBLIC_HOST=pkmntrade.club
# - ALLOWED_HOSTS=pkmntrade.club,127.0.0.1
restart: always
deploy:
mode: replicated
replicas: 4
@ -21,8 +24,7 @@ services:
# timeout: 10s
# retries: 3
# start_period: 30s
# secrets:
# - env_file_base64
# secrets:
# env_file_base64:
# environment: ENV_FILE_BASE64
celery:
<<: *common
image: badbl0cks/pkmntrade-club:stable
command: ["celery", "-A", "pkmntrade_club.django_project", "worker", "-l", "INFO", "-B", "-E"]