Add Redis service and Celery configuration to Docker setup

- Introduced Redis service in both docker-compose files for production and development.
- Updated web and celery services to use Redis as the broker and result backend.
- Added necessary environment variables for Celery in settings.py.
- Included new tasks and soil_data apps in Django settings and updated URL routing.
- Updated requirements.txt to include Celery and Redis dependencies.
This commit is contained in:
2026-02-27 13:09:00 +03:30
parent f6ac30aa34
commit 09e0c26c68
26 changed files with 828 additions and 13 deletions
+26
View File
@@ -33,6 +33,11 @@ services:
condition: service_healthy
restart: unless-stopped
redis:
image: redis:7-alpine
container_name: ai-redis
restart: unless-stopped
web:
build: .
container_name: ai-web
@@ -40,12 +45,33 @@ services:
- .env
environment:
DB_HOST: db
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
ports:
- "8020:8000"
celery:
build: .
container_name: ai-celery
command: celery -A config worker -l info
env_file:
- .env
environment:
DB_HOST: db
CELERY_BROKER_URL: redis://redis:6379/0
CELERY_RESULT_BACKEND: redis://redis:6379/0
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
volumes:
ai_mysql_data: