version: '2'
services:
  mysql:
    image: mysql:latest
    container_name: mysql
    volumes:
      - "./data/db:/var/lib/mysql"
    ports:
      - "3306:3306"
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=laravel_boilerplate
      - MYSQL_USER=root
      - MYSQL_PASSWORD=secret
  laravel-env:
    build: ./dockerfiles/laravel-env
    container_name: laravel-env
    depends_on:
      - mysql
    volumes:
      - ".:/var/www/laravel-boilerplate"
      - "./dockerfiles/config/laravel-env/php.ini:/usr/local/etc/php/php.ini"
      - "./dockerfiles/config/laravel-env/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini"
    #restart: always
  nginx:
    image: nginx:latest
    container_name: nginx
    depends_on:
      - laravel-env
    volumes:
      - ".:/var/www/laravel-boilerplate"
      - "./dockerfiles/config/nginx/default.conf:/etc/nginx/conf.d/default.conf"
    ports:
      - "80:80"
    restart: always
