version: '3.7'
services:
  dd-apps-mariadb:
    image: ${MARIADB_IMG-mariadb:10.6.5}
    container_name: dd-apps-mariadb
    # Arguments inspired by:
    # https://github.com/t0lya/headless-wordpress-preview/blob/master/docker-compose.yml
    command: [
        '--default_authentication_plugin=mysql_native_password',
        '--character-set-server=utf8mb4',
        '--collation-server=utf8mb4_unicode_ci'
    ]
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ${DB_FOLDER}/mariadb:/var/lib/mysql
    environment:
      MYSQL_ROOT_PASSWORD: ${MARIADB_PASSWORD}
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: ${WORDPRESS_MARIADB_PASSWORD}
    restart: unless-stopped
    healthcheck:
        test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
        timeout: 20s
        retries: 10
    networks:
      - dd_net
