version: '3.9'
services:
  db:
    image: mysql:8.0
    environment:
      MYSQL_DATABASE: real_estate
      MYSQL_ROOT_PASSWORD: root
      MYSQL_USER: user
      MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
    volumes:
      - mysql_data:/var/lib/mysql

  api:
    build: .
    ports:
      - "8000:8000"
    env_file:
      - .env
    depends_on:
      - db

volumes:
  mysql_data: