version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - itgclicklife_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=babd49c7ee39a037c8c63b31f1e3e8e7
      - MYSQL_DATABASE=b6a5f6fe5282b4f5d2b849cb08291c7d
      - MYSQL_USER=c0ddbf9e2dc3c15d49d63fe8c481831a
      - MYSQL_PASSWORD=1b390e3cf7a3759e599dfd9017d6fe4f
    networks:
      - itgclicklife_net
  wordpress:
    image: wordpress:latest
    volumes:
      - itgclicklife_wp_data:/var/www/html
    ports:
      - 50017:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=c0ddbf9e2dc3c15d49d63fe8c481831a
      - WORDPRESS_DB_PASSWORD=1b390e3cf7a3759e599dfd9017d6fe4f
      - WORDPRESS_DB_NAME=b6a5f6fe5282b4f5d2b849cb08291c7d
      - WP_LOCALE=pt_BR
    networks:
      - itgclicklife_net

volumes:
  itgclicklife_db_data:
  itgclicklife_wp_data:

networks:
  itgclicklife_net:

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