volumes:
  pg-data:

services:
  db:
    container_name: sozluk-postgres
    image: postgres:16.4-alpine
    user: postgres
    env_file: ../../conf/dev/postgres.env
    ports:
      - "5432:5432"
    volumes:
      - pg-data:/var/lib/postgresql/data

  redis:
    container_name: sozluk-redis
    image: redis:7.4-alpine
    user: redis

  rabbitmq:
    container_name: sozluk-rabbitmq
    image: rabbitmq:3.13-alpine

  web:
    container_name: sozluk-web
    build:
      context: ../..
      dockerfile: docker/dev/dev.Dockerfile
    command: python manage.py runserver 0.0.0.0:8000
    ports:
      - "8000:8000"
    extends:
      file: common.yml
      service: python

  celery-worker: &celery
    container_name: sozluk-celery-worker
    command: celery -A djdict worker -l info
    depends_on:
      - db
      - redis
      - rabbitmq
    extends:
      file: common.yml
      service: python

  celery-beat:
    <<: *celery
    container_name: sozluk-celery-beat
    command: celery -A djdict beat -l info
