version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - claudiodanta_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=d2cdc19421d66b4d23439f5468ab0b9d
      - MYSQL_DATABASE=0304255eec309d7964f2547ee301d49f
      - MYSQL_USER=2ae8ae474b2f9f95286e0b526d375eb8
      - MYSQL_PASSWORD=4c399258d497717901154c03821a91e7
    networks:
      - claudiodanta_net
  wordpress:
    image: wordpress:latest
    volumes:
      - claudiodanta_wp_data:/var/www/html
    ports:
      - 50016:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=2ae8ae474b2f9f95286e0b526d375eb8
      - WORDPRESS_DB_PASSWORD=4c399258d497717901154c03821a91e7
      - WORDPRESS_DB_NAME=0304255eec309d7964f2547ee301d49f
      - WP_LOCALE=pt_BR
    networks:
      - claudiodanta_net

volumes:
  claudiodanta_db_data:
  claudiodanta_wp_data:

networks:
  claudiodanta_net:

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