version: '3.8'
services:
  db:
    image: mariadb
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: flute
      MYSQL_DATABASE: flute
      MYSQL_USER: flute
      MYSQL_PASSWORD: flute
    command:
      - "--character-set-server=utf8mb4"
      - "--collation-server=utf8mb4_unicode_ci"

  php:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - ./:/var/www/html
    restart: always
    expose:
       - 9000
    depends_on:
      - db

  nginx:
    image: nginx:latest
    volumes:
      - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
      - ./:/var/www/html
    restart: always
    ports:
      - 8080:80
    depends_on:
      - php

volumes:
  db_data:
