volumes:
  pg-data:
  mq-data:

services:
  db:
    container_name: sozluk-postgres
    # postgres:17.6-alpine3.22
    image: postgres@sha256:3406990b6e4c7192317b6fdc5680498744f6142f01f0287f4ee0420d8c74063c
    user: postgres
    env_file: ../../conf/dev/postgres.env
    ports:
      - "5432:5432"
    volumes:
      - pg-data:/var/lib/postgresql/data

  redis:
    container_name: sozluk-redis
    # redis:8.2-alpine3.22
    image: redis@sha256:987c376c727652f99625c7d205a1cba3cb2c53b92b0b62aade2bd48ee1593232
    user: redis

  rabbitmq:
    container_name: sozluk-rabbitmq
    # rabbitmq:4.1-alpine
    image: rabbitmq@sha256:a6dbb0d4e409a371b0c4baa0cc844903be8702ad29e7917fd7f3d19207cb468e
    hostname: rabbitmq_local
    volumes:
      - mq-data:/var/lib/rabbitmq

  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
