version: "3"

services:

  web:
      image: webdevops/php-nginx:7.2
      volumes:
          - ./:/app
      working_dir: /app
      env_file: .env
      ports:
          - "8087:80"
      depends_on:
          - database
      environment:
          WEB_DOCUMENT_ROOT: /app/public
          WEB_DOCUMENT_INDEX: index.php
          PHP_DATE_TIMEZONE: "Europe/Paris"
          PHP_DISPLAY_ERRORS: 1

  database:
      image: mysql:5.7
      volumes:
          - ./docker/database:/var/lib/mysql
      environment:
          MYSQL_ROOT_PASSWORD: root
          MYSQL_DATABASE: mydatabase

  phpmyadmin:
      image: phpmyadmin/phpmyadmin
      depends_on:
          - database
      ports:
          - "8080:80"
      environment:
          MYSQL_ROOT_PASSWORD: root
          PMA_HOST: database
