version: '3'

services:

  php:
    build: .dev/php
    volumes:
      - "./:/project:cached"
    depends_on:
      - mysql
      - maildev
    networks:
      - mysql
      - php
  nginx:
    build: .dev/nginx
    ports:
      - 80:80
    volumes:
      - "./:/project:cached"
    depends_on:
      - php
    networks:
      - php
  mysql:
    image: mysql:5.6
    command: --default-authentication-plugin=mysql_native_password
    environment:
      - "MYSQL_ROOT_PASSWORD=root"
      - "MYSQL_USER=salesworlt"
      - "MYSQL_PASSWORD=salesworlt"
      - "MYSQL_DATABASE=salesworlt"
    volumes:
      - .dev/mysql:/var/lib/mysql
    networks:
      - mysql
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: dev_pma
    links:
      - mysql
    environment:
      PMA_HOST: mysql
      PMA_PORT: 3306
      PMA_ARBITRARY: 1
    networks:
      - mysql
    ports:
      - 8183:80
  node:
    build: .dev/node
    volumes:
      - "./:/project"
    depends_on:
      - nginx
  maildev:
    image: djfarrelly/maildev
    command: ["bin/maildev", "--web", "80", "--smtp", "25", "--hide-extensions", "STARTTLS"]
    ports:
      - 8001:80
    networks:
      - php

networks:
  mysql:
  php:
