version: '3.1'
services:
  #PHP Service
  nginx:
    image: nginx:latest
    ports:
    - "8080:8080"
    - "443:443"
    volumes:
    - ./nginx/hosts:/etc/nginx/conf.d
    - ./../public:/var/www/html/public:cached
    - ./nginx/logs:/var/log/nginx
    links:
      - php
    expose:
      - "8080"
  php:
    build: ./php
    links:
      - db
    volumes:
      - ./../:/var/www/html
  db:
    image: mysql:5.7
    container_name: db
    environment:
      MYSQL_ROOT_PASSWORD: 123
      MYSQL_DATABASE: laravel
      MYSQL_USER: test
      MYSQL_PASSWORD: password
    ports:
      - "3306:3306"
