version: '2.1'

services:
  db:
    hostname: mysqllocal
    image: mysql:5.7
    ports:
      - "3306:3306"
    environment:
      - "MYSQL_ROOT_PASSWORD=adminroot"
      - "MYSQL_USER=user01"
      - "MYSQL_PASSWORD=user01"
      - "MYSQL_DATABASE=caisse"
    volumes:
      - ./docker/db/:/docker-entrypoint-initdb.d/
  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    depends_on:
      - db
    links:
      - db
    ports:
      - "8889:80"
  php-apache:
    image: webdevops/php-apache-dev:7.1
    depends_on:
      - db
    ports:
      - "8888:80"
    links:
      - db
    volumes:
      - ./:/var/www/html
    environment:
      - "WEB_DOCUMENT_ROOT=/var/www/html"
  composer:
    restart: 'no'
    image: composer
    depends_on:
      - db
    command: install
    volumes:
      - ./:/app
