version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - liviadermato_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=35bbaf7eb270f38a000f30789bf2c4d0
      - MYSQL_DATABASE=81bdbd66698dd1f3a9881794264eb733
      - MYSQL_USER=9d5ba33aaab3282da9657f119641ed23
      - MYSQL_PASSWORD=5d0bcb70370fd6db72dea434e3fd9478
    networks:
      - liviadermato_net
  wordpress:
    image: wordpress:latest
    volumes:
      - liviadermato_wp_data:/var/www/html
    ports:
      - 50008:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=9d5ba33aaab3282da9657f119641ed23
      - WORDPRESS_DB_PASSWORD=5d0bcb70370fd6db72dea434e3fd9478
      - WORDPRESS_DB_NAME=81bdbd66698dd1f3a9881794264eb733
      - WP_LOCALE=pt_BR
    networks:
      - liviadermato_net

volumes:
  liviadermato_db_data:
  liviadermato_wp_data:

networks:
  liviadermato_net:

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