version: "3"

services:
  db:
    image: mysql:latest
    environment:
      MYSQL_ROOT_PASSWORD: fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6
      MYSQL_DATABASE: learnsteam_quiz
    ports:
      - "33062:3306"
    volumes:
      - db-learnsteam-quiz:/var/lib/mysql
  app:
    build:
      context: ../../
      dockerfile: docker/local/Dockerfile
    image: learnsteam/learnsteam-quiz:local
    ports:
      - "3100:3100"
    environment:
      DB_HOST: db
      DB_PORT: 3306
      DB_USER: root
      DB_PASSWORD: fbOgZ6Xxn5VXBYihjqygRXyaK6ZUgKL6
      DB_NAME: learnsteam_quiz
    depends_on:
      - db
    restart: always
volumes:
  db-learnsteam-quiz:
