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

  local:
    image: mariadb:10.11
    environment:
      - MYSQL_DATABASE=absen
      - MYSQL_USER=localtest
      - MYSQL_PASSWORD=localtest
      - MYSQL_ROOT_PASSWORD=localtest
    volumes:
      - ./database/config:/docker-entrypoint-initdb.d

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