version: "3.4"

services:
  mariadb:
    build:
      context: ./docker
      dockerfile: ./Dockerfile.mariadb
    environment:
      #- MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
      - MARIADB_ROOT_PASSWORD=SECRET
      - MARIADB_USER=web
    ports:
      - 3306:3306
    volumes:
      - db_vol:/var/lib/mysql

  php:
    build:
      context: .
      dockerfile: ./docker/Dockerfile.php
    volumes:
      - ./:/app
    user: "1000"

  nginx:
    build:
      context: .
      dockerfile: ./docker/Dockerfile.nginx
    depends_on:
      - php
      - mariadb
    ports:
      - 80:80
    volumes:
      - ./nginx/log:/var/log/nginx
      - ./:/app

volumes:
  db_vol: