version: "3.7"
services:
  web:
    container_name: lab-3-apache-php
    build: .
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./src:/var/www/html
    depends_on:
      - mariadb
    env_file: 
      - .env

  mariadb:
    container_name: lab-3-mariadb
    image: mariadb
    volumes:
      - mariadb:/var/lib/mysql
    ports:
      - 3306:3306
    restart: always
    environment:
      MYSQL_ALLOW_EMPTY_PASSWORD: "no"
      MYSQL_ROOT_PASSWORD: toor

      MYSQL_USER: $MYSQL_USER
      MYSQL_PASSWORD: $MYSQL_PASSWORD
      MYSQL_DATABASE: $MYSQL_DATABASE

  phpmyadmin:
    container_name: lab-3-phpmyadmin
    image: phpmyadmin/phpmyadmin
    depends_on:
      - mariadb
    restart: always
    ports:
      - 8080:80
    environment:
      PMA_HOST: mariadb
      MYSQL_ROOT_PASSWORD: toor

volumes:
  mariadb:
