version: '2'

services:
  php:
    build: 
      context: ./
      dockerfile: ./config/docker/php/Dockerfile

    expose:
      - 9000
    links:
      - mysql:mysql
    volumes:
      - ./config/docker/php/php.ini:/usr/local/etc/php/conf.d/php.ini
      - ./:/var/www/html

  nginx:
    image: nginx:1.12.0
    depends_on:
      - php
    ports:
      - "80:80"
    links:
      - php
    volumes:
      - ./config/docker/nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
      - ./:/var/www/html

  mysql:
    image: mysql:5.7
    ports:
      - "3306:3306"
    volumes:
      - ./config/docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
      - data-mysql-5.7:/var/lib/mysql
    restart: always
    env_file: .env

volumes:
  data-mysql-5.7:
    driver: local

version: '2'

services:
  php:
    build: 
      context: ./
      dockerfile: ./config/docker/php/Dockerfile

    expose:
      - 9000
    links:
      - mysql:mysql
    volumes:
      - ./config/docker/php/php.ini:/usr/local/etc/php/conf.d/php.ini
      - ./:/var/www/html

  nginx:
    image: nginx:1.12.0
    depends_on:
      - php
    ports:
      - "80:80"
    links:
      - php
    volumes:
      - ./config/docker/nginx/conf.d/dev.conf:/etc/nginx/conf.d/dev.conf
      - ./:/var/www/html

  mysql:
    image: mysql:5.7
    ports:
      - "3306:3306"
    volumes:
      - ./config/docker/mysql/my.cnf:/etc/mysql/conf.d/my.cnf
      - data-mysql-5.7:/var/lib/mysql
    env_file: .env

volumes:
  data-mysql-5.7:
    driver: local

Disable auto restart of a docker-container
Disable auto restart of a docker-container
