version: '3.8'

services:
  web:
    build: .
    ports:
      - "8080:80"
    volumes:
      - .:/var/www/html
    environment:
      - DOCKER_ENV=development
    depends_on:
      - db
    networks:
      - proam-network

  db:
    image: mysql:8.0
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: proamcotty
      MYSQL_USER: proamcotty
      MYSQL_PASSWORD: proamcotty
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql
      - ./lib/proamcottydaga.sql:/docker-entrypoint-initdb.d/init.sql
    networks:
      - proam-network

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8081:80"
    environment:
      PMA_HOST: db
      PMA_USER: root
      PMA_PASSWORD: root
    depends_on:
      - db
    networks:
      - proam-network

networks:
  proam-network:
    driver: bridge

volumes:
  db_data:
