version: '3.2'
services:
  app:
    container_name: portofolio
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - '2081:80'
    volumes:
      - .:/app
    depends_on:
      - mysql
    environment:
      - DB_HOST=mysql
      - DB_USER=portofolio
      - DB_PASSWORD=portofolio
      - DB_PORT=3306

  mysql:
    image: mysql:5.7
    environment:
      - MYSQL_HOST=localhost
      - MYSQL_ROOT_PASSWORD=verysecret
      - MYSQL_DATABASE=portofolio
      - MYSQL_USER=portofolio
      - MYSQL_PASSWORD=portofolio
    volumes:
      - ./database/config:/docker-entrypoint-initdb.d

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    ports:
      - '2080:80'
    environment:
      - PMA_ARBITRARY=1
      - PMA_HOST=mysql
      - PMA_USER=portofolio
      - PMA_PASSWORD=portofolio
      - PMA_PORT=3306
    depends_on:
      - mysql