version: '3.9'

services:
  web:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: hotel-xain-web
    volumes:
      - ./xain-hotel:/var/www/html/xain-hotel
      - ./ssl:/etc/ssl # Montar os arquivos SSL
    ports:
      - "80:80"
      - "443:443" # Mapear a porta 443 para HTTPS
    networks:
      - hotel-network
    depends_on:
      - db

  db:
    image: mysql:8.0
    container_name: hotel-xain-db
    environment:
      MYSQL_ROOT_PASSWORD: Destiny@123
      MYSQL_DATABASE: destinyhotels-353031377234
      MYSQL_USER: destiny
      MYSQL_PASSWORD: Destiny@123
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql
      - ./hotel.sql:/docker-entrypoint-initdb.d/hotel.sql
    networks:
      - hotel-network
    command: --sql_mode="STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION"

networks:
  hotel-network:
    driver: bridge

volumes:
  db_data:
    name: hotel-xain_db_data
