version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - osbeudocom_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=cd1858c926d1635af89866720f7076d9
      - MYSQL_DATABASE=8f75e148fec9242754f4e8b55c5f2022
      - MYSQL_USER=d6faede5a1c0b8ed1a5d5bf6c53c7da9
      - MYSQL_PASSWORD=92447f5b29a62a888739202f9dd45bfe
    networks:
      - osbeudocom_net
  wordpress:
    image: wordpress:latest
    volumes:
      - osbeudocom_wp_data:/var/www/html
    ports:
      - 50014:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=d6faede5a1c0b8ed1a5d5bf6c53c7da9
      - WORDPRESS_DB_PASSWORD=92447f5b29a62a888739202f9dd45bfe
      - WORDPRESS_DB_NAME=8f75e148fec9242754f4e8b55c5f2022
      - WP_LOCALE=pt_BR
    networks:
      - osbeudocom_net

volumes:
  osbeudocom_db_data:
  osbeudocom_wp_data:

networks:
  osbeudocom_net:

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