version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - luciopaivahc_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=fef3e2bffb274c5569d95597585d1ea7
      - MYSQL_DATABASE=e1a6d3238a80cb30b3b613c8c2f69c3c
      - MYSQL_USER=c1214bda26f6a55dbe0939bf82b68d7a
      - MYSQL_PASSWORD=b4f34c29a61e999a7da8a75b038cdc79
    networks:
      - luciopaivahc_net
  wordpress:
    image: wordpress:latest
    volumes:
      - luciopaivahc_wp_data:/var/www/html
    ports:
      - 50010:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=c1214bda26f6a55dbe0939bf82b68d7a
      - WORDPRESS_DB_PASSWORD=b4f34c29a61e999a7da8a75b038cdc79
      - WORDPRESS_DB_NAME=e1a6d3238a80cb30b3b613c8c2f69c3c
      - WP_LOCALE=pt_BR
    networks:
      - luciopaivahc_net

volumes:
  luciopaivahc_db_data:
  luciopaivahc_wp_data:

networks:
  luciopaivahc_net:

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