| services: | |
| db: | |
| image: postgres:15 | |
| volumes: | |
| - postgres_data:/var/lib/postgresql/data | |
| environment: | |
| POSTGRES_DB: educonnect_db | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| ports: | |
| - "5433:5432" | |
| redis: | |
| image: redis:7-alpine | |
| ports: | |
| - "6380:6379" | |
| backend: | |
| build: ./backend | |
| command: python manage.py runserver 0.0.0.0:8000 | |
| volumes: | |
| - ./backend:/app | |
| - media_volume:/app/media | |
| - static_volume:/app/staticfiles | |
| ports: | |
| - "8000:8000" | |
| env_file: | |
| - ./backend/.env | |
| environment: | |
| - DEBUG=True | |
| - DB_HOST=db | |
| - DB_PORT=5432 | |
| - DB_NAME=educonnect_db | |
| - DB_USER=postgres | |
| - DB_PASSWORD=postgres | |
| - REDIS_HOST=redis | |
| - CELERY_BROKER_URL=redis://redis:6379/0 | |
| - CELERY_RESULT_BACKEND=redis://redis:6379/0 | |
| depends_on: | |
| - db | |
| - redis | |
| celery: | |
| build: ./backend | |
| command: celery -A educonnect worker -l info | |
| volumes: | |
| - ./backend:/app | |
| env_file: | |
| - ./backend/.env | |
| environment: | |
| - DEBUG=True | |
| - DB_HOST=db | |
| - DB_PORT=5432 | |
| - DB_NAME=educonnect_db | |
| - DB_USER=postgres | |
| - DB_PASSWORD=postgres | |
| - REDIS_HOST=redis | |
| - CELERY_BROKER_URL=redis://redis:6379/0 | |
| - CELERY_RESULT_BACKEND=redis://redis:6379/0 | |
| depends_on: | |
| - db | |
| - redis | |
| channels: | |
| build: ./backend | |
| command: daphne -b 0.0.0.0 -p 8001 educonnect.asgi:application | |
| volumes: | |
| - ./backend:/app | |
| ports: | |
| - "8001:8001" | |
| env_file: | |
| - ./backend/.env | |
| environment: | |
| - DEBUG=True | |
| - DB_HOST=db | |
| - DB_PORT=5432 | |
| - DB_NAME=educonnect_db | |
| - DB_USER=postgres | |
| - DB_PASSWORD=postgres | |
| - REDIS_HOST=redis | |
| depends_on: | |
| - db | |
| - redis | |
| frontend: | |
| build: ./frontend | |
| volumes: | |
| - ./frontend:/app | |
| - /app/node_modules | |
| ports: | |
| - "5173:3000" | |
| environment: | |
| - VITE_API_URL=http://localhost:8000/api | |
| depends_on: | |
| - backend | |
| volumes: | |
| postgres_data: | |
| media_volume: | |
| static_volume: | |