version: '3.8'

services:
  db3:
    image: mysql:8.0
    command: --default-authentication-plugin=mysql_native_password
    volumes:
      - data:/var/lib/mysql
      - ./clubvelas24Feb.sql:/docker-entrypoint-initdb.d/init.sql
    environment:
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=manager
      - MYSQL_PASSWORD=secret
    ports:
      - 3310:3306
    networks:
      - clubvelas-network
    restart: unless-stopped

  web3:
    image: wordpress:6.7.2
    environment:
      - WORDPRESS_DB_HOST=db3:3306
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_USER=manager
      - WORDPRESS_DB_PASSWORD=secret
    ports:
      - 3003:80
    networks:
      - clubvelas-network
    volumes:
      - ./clubvelas.velasresorts.com:/var/www/html/
      - ./php/wp-config.php:/var/www/html/wp-config.php
    restart: always

volumes:
  data:

networks:
  clubvelas-network:
    driver: bridge
