version: '3.9'

services:
  web:
    build: .
    container_name: aliweb_web
    ports:
      - "8880:80"   # accesible desde http://<IP>:8080
    volumes:
      - .:/var/www/html
    environment:
      DB_HOST: db
      DB_NAME: ALIWEB
      DB_USER: root
      DB_PASS: 1234   # coincide con lo que usarás en Conexion.php
    depends_on:
      - db
    restart: unless-stopped
    command: apache2-foreground

  db:
    image: mysql:8.0
    container_name: aliweb_db
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 1234
      MYSQL_DATABASE: ALIWEB
    ports:
      - "3308:3306"
    volumes:
      - db_data:/var/lib/mysql
    command: --innodb-buffer-pool-size=128M --max-connections=20

volumes:
  db_data:
