version: "2"
services:

  datastore:
    image: busybox
    container_name: ${PROJECT_ID}-datastore
    volumes:
      - .:/app

  web:
    image: xtreamwayz/nginx
    container_name: ${PROJECT_ID}-web
    ports:
      - "80:80"
    volumes_from:
      - datastore
    links:
      - php

  php:
    image: xtreamwayz/php
    container_name: ${PROJECT_ID}-php
    volumes_from:
      - datastore
    links:
      - db
      - redis
      - mailhog

  db:
    image: xtreamwayz/mysql
    container_name: ${PROJECT_ID}-db
    ports:
      - "3306:3306"
    env_file: .env
    #volumes:
    #  - ./resources/mysql-dump:/docker-entrypoint-initdb.d
    volumes_from:
      - datastore

  redis:
    image: redis:3-alpine
    container_name: ${PROJECT_ID}-redis
    ports:
      - "6379:6379"

  mailhog:
    image: mailhog/mailhog
    container_name: ${PROJECT_ID}-mailhog
    ports:
      - "1025:1025"
      - "8025:8025"

version: "2"
services:

  datastore:
    image: busybox
    container_name: ${PROJECT_ID}-datastore
    volumes:
      - .:/app

  web:
    image: xtreamwayz/nginx
    container_name: ${PROJECT_ID}-web
    ports:
      - "80:80"
    volumes_from:
      - datastore
    links:
      - php

  php:
    image: xtreamwayz/php
    container_name: ${PROJECT_ID}-php
    volumes_from:
      - datastore
    links:
      - db
      - redis
      - mailhog

  db:
    image: xtreamwayz/mysql
    container_name: ${PROJECT_ID}-db
    ports:
      - "3306:3306"
    env_file: .env
    #volumes:
    #  - ./resources/mysql-dump:/docker-entrypoint-initdb.d  # Import .sql files
    #  - ./data/mysql-data:/var/lib/mysql                    # persistent database
    volumes_from:
      - datastore

  redis:
    image: redis:3-alpine
    container_name: ${PROJECT_ID}-redis
    ports:
      - "6379:6379"

  mailhog:
    image: mailhog/mailhog
    container_name: ${PROJECT_ID}-mailhog
    ports:
      - "1025:1025"
      - "8025:8025"

Add example for persistant database
Add example for persistant database
