version: "3.7"

services:
  nginx:
    image: nginx:alpine
    container_name: nginx_mebel
    ports:
      - "80:80"
    volumes:
      - .:/var/www/html
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    depends_on:
      - php

  php:
    build:
      context: .
      dockerfile: Dockerfile.php
    container_name: php74_mebel
    volumes:
      - .:/var/www/html
    depends_on:
      - mysql

  mysql:
    image: mysql/mysql-server
    container_name: mysql_mebel
    command: --default-authentication-plugin=mysql_native_password
    environment:
      MYSQL_DATABASE: larek
      MYSQL_USER: larek
      MYSQL_PASSWORD: avatar910
    ports:
      - 9797:3306
    volumes:
      - "./files/init.sql:/docker-entrypoint-initdb.d/1.sql"
