version: '3.8'
services:
  app:
    build:
      context: .
    working_dir: /var/www
    volumes:
      - ./:/var/www
    depends_on:
      - database
    ports:
      - "80:80"
      #- "5173:5173"
  node:
    image: "node:21"
    working_dir: /var/www
    volumes:
      - ./:/var/www  # Mount the Vue.js source code
    ports:
      - "5173:5173"  # Expose the Vue.js app port
    command: ["npm", "run", "dev"]  # Start the Vue.js app
  database:
    image: mysql:8.0
    volumes:
      - dbdata:/var/lib/mysql
    environment:
      MYSQL_DATABASE: ${DB_DATABASE}
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_USER: ${DB_USERNAME}
    ports:
      - "3307:3306"

  pma:
    image: phpmyadmin:5.1
    environment:
      - PMA_ARBITRARY=1
      - PMA_HOST=${DB_HOST}
      - PMA_USER=${DB_USERNAME}
      - PMA_PASSWORD=${DB_PASSWORD}
      - PMA_PORT=${DB_PORT}
      - UPLOAD_LIMIT=${UPLOAD_LIMIT}
    depends_on:
      - database
    ports:
      - "8888:80"

  mailhog:
    image: mailhog/mailhog
    logging:
      driver: 'none'
    ports:
      - "1025:1025"
      - "8025:8025"
volumes:
  dbdata: