version: '3.8'

services:
  web:
    build: .
    ports:
      - "8180:80"
    volumes:
      - ./src:/var/www/html
      - ./logs:/var/log/apache2
    depends_on:
      - db
    environment:
      - APACHE_DOCUMENT_ROOT=/var/www/html
    networks:
      - seoai-network

  db:
    image: mysql:8.0
    ports:
      - "3316:3306"
    environment:
      MYSQL_ROOT_PASSWORD: ulik9910
      MYSQL_DATABASE: seoai_db
      MYSQL_USER: seoai_user
      MYSQL_PASSWORD: seoai_pass
    volumes:
      - mysql_data:/var/lib/mysql
      - ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
    networks:
      - seoai-network

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - "8080:80"
    environment:
      PMA_HOST: db
      PMA_PORT: 3306
      PMA_USER: root
      PMA_PASSWORD: ulik9910
    depends_on:
      - db
    networks:
      - seoai-network

volumes:
  mysql_data:

networks:
  seoai-network:
    driver: bridge
