version: '3.8'
services:
  app:
    build: .
    ports:
      - "8000:80"
    environment:
      DB_HOST: db
      DB_DATABASE: laravel
      DB_USERNAME: laraveluser
      DB_PASSWORD: laravelpassword
    volumes:
      - .:/var/www/html
    depends_on:
      - db

  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: laravel
      MYSQL_USER: laraveluser
      MYSQL_PASSWORD: laravelpassword
      MYSQL_ROOT_PASSWORD: rootpassword
