version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - rogerdeffmcc_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=a8321e97a418555f5bc41696e7e07599
      - MYSQL_DATABASE=2731bd226ea06b9d4e1173a589ea9009
      - MYSQL_USER=4492f9b035085685f65eb41986879ab2
      - MYSQL_PASSWORD=bfe2161406a87c41b541b1a57c560ace
    networks:
      - rogerdeffmcc_net
  wordpress:
    image: wordpress:latest
    volumes:
      - rogerdeffmcc_wp_data:/var/www/html
    ports:
      - 50007:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=4492f9b035085685f65eb41986879ab2
      - WORDPRESS_DB_PASSWORD=bfe2161406a87c41b541b1a57c560ace
      - WORDPRESS_DB_NAME=2731bd226ea06b9d4e1173a589ea9009
      - WP_LOCALE=pt_BR
    networks:
      - rogerdeffmcc_net

volumes:
  rogerdeffmcc_db_data:
  rogerdeffmcc_wp_data:

networks:
  rogerdeffmcc_net:

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