services: mariadb: image: mariadb:10.4 container_name: mariadb_simple restart: unless-stopped ports: - "0.0.0.0:3306:3306" environment: - MYSQL_ROOT_PASSWORD_FILE=/run/secrets/mysql_root_password volumes: - mariadb_simple_data:/var/lib/mysql - /etc/localtime:/etc/localtime - /var/backups/mysql:/backups secrets: - mysql_root_password networks: - default - db-migration command: > --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --max-connections=200 --innodb-buffer-pool-size=256M --max-allowed-packet=16M --sql-mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION --slow-query-log=1 --long-query-time=5 --skip-name-resolve --innodb-rollback-on-timeout=ON --lock-wait-timeout=60 healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s timeout: 5s retries: 5 logging: driver: "json-file" options: max-size: "10m" max-file: "3" volumes: mariadb_simple_data: name: mariadb_simple_data secrets: mysql_root_password: file: .secrets/mysql_root_password networks: default: name: mariadb_simple_default db-migration: external: true