version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile-php
    volumes:
      - ./:/var/www/html
    expose:
      - "9000"
    networks:
      - laravel-net

  web:
    image: nginx:stable-alpine
    volumes:
      - ./:/var/www/html
      - ./nginx.conf:/etc/nginx/conf.d/default.conf
    ports:
      - "8081:80"
    depends_on:
      - app
    networks:
      - laravel-net

  node:
    build:
      context: .
      dockerfile: Dockerfile-node
    volumes:
      - ./:/var/www/html
    command: npm run dev -- --host 0.0.0.0
    ports:
      - "5173:5173"   # expose ke host
    networks:
      - laravel-net
networks:
  laravel-net:
    driver: bridge
