services:
  web:
    build: .
    container_name: php_web
    ports:
      - "8081:80"
    volumes:
      - ./:/var/www/html
      - node_modules:/var/www/html/node_modules
    depends_on:
      - db
    environment:
      DB_HOST: db
      DB_NAME: app
      DB_USER: app
      DB_PASS: app

  db:
    image: mysql:8.0
    container_name: mysql_db_copiloto
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: app
      MYSQL_USER: app
      MYSQL_PASSWORD: app
    ports:
      - "3307:3306"
    volumes:
      - dbdata:/var/lib/mysql

volumes:
  dbdata:
  node_modules:
