version: "3.7"
services:
  db:
    image: mariadb:10.6.4-focal
    command: '--default-authentication-plugin=mysql_native_password'
    volumes:
      - jcbadvocacia_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=8ef22103456bac1fef9fb159183a150b
      - MYSQL_DATABASE=1f0f38cc1079547466009ac3c3eb8821
      - MYSQL_USER=88e82f253360da791010568966721e7c
      - MYSQL_PASSWORD=8e12e2e7624a343d19279e4201b12202
    networks:
      - jcbadvocacia_net
  wordpress:
    image: wordpress:latest
    volumes:
      - jcbadvocacia_wp_data:/var/www/html
    ports:
      - 50013:80
    deploy:
      replicas: 1
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=88e82f253360da791010568966721e7c
      - WORDPRESS_DB_PASSWORD=8e12e2e7624a343d19279e4201b12202
      - WORDPRESS_DB_NAME=1f0f38cc1079547466009ac3c3eb8821
      - WP_LOCALE=pt_BR
    networks:
      - jcbadvocacia_net

volumes:
  jcbadvocacia_db_data:
  jcbadvocacia_wp_data:

networks:
  jcbadvocacia_net:

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