---
version: "3"

services:
  wordpress:
    image: "wordpress"
    ports:
      - "8080:80"
    dns: 4.2.2.4
    volumes:
      - "./entrypoint.sh:/usr/local/bin/entrypoint.sh:z"
      - "./sample-wp-block-theme/:/var/www/html/wp-content/themes/sample-wp-block-theme:z"
    entrypoint: ["/usr/local/bin/entrypoint.sh"]
    networks:
      - backend
    environment:
      - WORDPRESS_DB_HOST=db
      - WORDPRESS_DB_USER=wordpress
      - WORDPRESS_DB_PASSWORD=wordpress
      - WORDPRESS_DB_NAME=wordpress
      - WORDPRESS_TABLE_PREFIX=wp_
      - PAGER=more
    container_name: "samplewpblocktheme_wordpress"

  db:
    image: "mariadb:10.6"
    ports:
      - 3306:3306
    volumes:
      - "mariadb:/var/lib/mysql"
    networks:
      - backend
    environment:
      - MYSQL_ROOT_PASSWORD=wordpress
      - MYSQL_DATABASE=wordpress
      - MYSQL_USER=wordpress
      - MYSQL_PASSWORD=wordpress
    container_name: "samplewpblocktheme_db"

volumes:
  mariadb:

networks:
  backend:
