version: '3'
services:
  web:
    image: nginx:latest
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/conf.d/nginx.conf
      - ./app:/app
    links:
      - php
      - mysql
  php:
    build:
      context: .
      dockerfile: PHP.Dockerfile
    volumes:
      - ./app:/app
    environment:
      DB_USER_NAME: 'grisu'
      DB_PASS: 'secret'
  mysql:
    image: mariadb:latest
    environment:
      MYSQL_ROOT_PASSWORD: 'secret'
      MYSQL_USER: 'grisu'
      MYSQL_PASSWORD: 'secret'
      MYSQL_DATABASE: 'tutorial'
    volumes:
      - mysqldata:/var/lib/mysql
    ports:
      - 3306:3306
volumes:
  mysqldata: {}
