version: '3.8'  # Agregar versión para evitar problemas

services:
  db:
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - data:/var/lib/mysql
      - ./terminos.sql:/docker-entrypoint-initdb.d/init.sql
    environment:
      - MYSQL_ROOT_PASSWORD=secret 
      - MYSQL_DATABASE=wordpress 
      - MYSQL_USER=manager 
      - MYSQL_PASSWORD=secret
    ports:
      - 3307:3306
    networks:
      - laravel-network

  web:
    image: wordpress:5.2.4
    environment:
      - WORDPRESS_DB_HOST=db:3306  # Referencia correcta a la BD
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_USER=manager
      - WORDPRESS_DB_PASSWORD=secret
    ports:
      - 3000:80
    networks:
      - laravel-network
    volumes:
      - ./terms.velasresorts.com:/var/www/html

volumes:
  data:

networks:
  laravel-network:
    driver: bridge
