version: '3.2'
services:
  app:
    container_name: portofolio
    build:
      context: .docker
      dockerfile: Dockerfile
    ports:
      - '2180:80'
    volumes:
      - .:/app
    command: >
      sh -c "php artisan serve --host=0.0.0.0 --port=80"

  mysql:
    image: mariadb:10.11
    environment:
      - MYSQL_HOST=localhost
      - MYSQL_ROOT_PASSWORD=verysecret
      - MYSQL_DATABASE=portofolio
      - MYSQL_USER=portofolio
      - MYSQL_PASSWORD=portofolio
    volumes:
      - ./.docker/database:/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