services:
  mysql:
    image: mysql:5.7.42
    container_name: mysql-5.7
    restart: always
    ports:
      - "3307:3306"
    environment:

      MYSQL_ROOT_PASSWORD: dt0214DT02!$
      MYSQL_USER: dt02
      MYSQL_PASSWORD: dt0214DT02!$
    volumes:
      - /var/www/html/newpajoohyar/mysql:/var/lib/mysql
      - ./init.sql:/docker-entrypoint-initdb.d/init.sql
      - ./mysql-config/my.cnf:/etc/mysql/conf.d/my.cnf

    networks:
      - laravel-net

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: phpmyadmin-5-7
    restart: always
    ports:
      - "8081:80"
    environment:
      PMA_HOST: mysql
      PMA_ABSOLUTE_URI: "https://dev-mysql.pajoohyar.ir/"
    networks:
      - laravel-net

  laravel-core:
    build:
      context: .
      dockerfile: dockerfile
    ports:
      - "9000:80"
    restart: always
    container_name: laravel-core
    volumes:
      - .:/var/www/html/
    depends_on:
      - mysql
    networks:
      - laravel-net

networks:
  laravel-net:
    driver: bridge
    ipam:
      config:
        - subnet: 172.23.0.0/16
