version: '3.8' 

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

  web2:
    image: wordpress:6.5.5
    restart: unless-stopped
    environment:
      - WORDPRESS_DB_HOST=db2:3306  
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_DB_USER=manager
      - WORDPRESS_DB_PASSWORD=secret
    ports:
      - 3002:80
    networks:
      - magazine-network
    volumes:
      - ./magazine.velasresorts.com:/var/www/html/
      - ./php/wp-config.php:/var/www/html/wp-config.php



volumes:
  data:

networks:
  magazine-network:
    driver: bridge
