version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - bembrotoscom_db_data:/var/lib/mysql
    deploy:
      replicas: 1
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          memory: 512M
          cpus: "0.5"
        reservations:
          memory: 256M
          cpus: "0.25"
    environment:
      - MYSQL_ROOT_PASSWORD=49aca3a05dbbc5fabaf7b54dbe5ee38a
      - MYSQL_DATABASE=e36418976521c5895067cbbbd718635b
      - MYSQL_USER=4fafe46d669686955d8dd8072094755f
      - MYSQL_PASSWORD=42af3bbd4db83e772b1e4f9aa93946ae
    networks:
      - bembrotoscom_net
  wordpress:
    image: wordpress:latest
    volumes:
      - bembrotoscom_wp_data:/var/www/html
    ports:
      - 50006:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=4fafe46d669686955d8dd8072094755f
      - WORDPRESS_DB_PASSWORD=42af3bbd4db83e772b1e4f9aa93946ae
      - WORDPRESS_DB_NAME=e36418976521c5895067cbbbd718635b
      - WP_LOCALE=pt_BR
    networks:
      - bembrotoscom_net

volumes:
  bembrotoscom_db_data:
  bembrotoscom_wp_data:

networks:
  bembrotoscom_net:

# Comando para alterar siteurl e home no WordPress
# mysql -u root -p -e "USE e36418976521c5895067cbbbd718635b; UPDATE wp_options SET option_value='http://bembrotos.com.br' WHERE option_name IN ('siteurl', 'home');"
