data:
  image: busybox:latest
  volumes:
    - ./:/app
  entrypoint: tail -f /dev/null

app:
  build: docker/php
  working_dir: /app
  volumes_from:
    - data
  expose:
    - 9000
  links:
    - db
    - mailcatcher
  environment:
    XDEBUG_CONFIG: "idekey=PHPSTORM remote_enable=On remote_connect_back=On"

nginx:
  image: nginx:latest
  ports:
    - "80:80"
  volumes:
    - ./:/app
    - ./docker/nginx/vhost.conf:/etc/nginx/conf.d/vhost.conf
  links:
    - app

mailcatcher:
    image: schickling/mailcatcher:latest
    ports:
      - "1080:1080"

db:
  image: mysql:5.7
  volumes:
    - /var/lib/mysql
  ports:
    - "3306:3306"
  environment:
    MYSQL_ROOT_PASSWORD: root
    MYSQL_DATABASE: yii2-starter-kit
    MYSQL_USER: ysk_dbu
    MYSQL_PASSWORD: ysk_pass