services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/var/www/html
      - /var/www/html/vendor
    ports:
      - "8000:80"
    depends_on:
      - db

  vite:
    image: node:22.16.0-alpine
    working_dir: /var/www/html
    volumes:
      - .:/var/www/html
      - /var/www/html/node_modules
    command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
    ports:
      - "5173:5173"

  db:
    image: mysql:8.0.30
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: absadmin_taquilla_sass_test
      MYSQL_USER: root
      MYSQL_PASSWORD: root
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:
