services:
  # frontend:
  #   build:
  #     context: ./frontend
  #   ports:
  #     - "80:3000"
  #   depends_on:
  #     - django

  django:
    build:
      context: ./backend
    ports:
      - "8000:8000"
    depends_on:
      - db
    volumes:
      - ./backend:/app
      - media_data:/app/media
    command: ["sh", "-c", "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"]


  db:
    image: postgres:16
    environment:
      POSTGRES_DB: shop_db
      POSTGRES_USER: byeto
      POSTGRES_PASSWORD: vuhbyq-cypMu0-sirbon
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5434:5432"


volumes:
  postgres_data:
  media_data:


