version: "3"

services:
  app:
    build: php
    working_dir: /app
    volumes:
      - ../:/app
    depends_on:
      - db

  nginx:
    image: nginx:1.12-alpine
    ports:
      - 80:80
    volumes:
      - ../:/app
      - ./nginx/vhost.conf:/etc/nginx/conf.d/vhost.conf
    depends_on:
      - app

  db:
    image: mysql:8
    volumes:
      - ./mysql/config.cnf:/etc/mysql/conf.d/config.cnf
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: yii2-starter-kit
      MYSQL_USER: ysk_dbu
      MYSQL_PASSWORD: ysk_pass
