How to set up MariaDB with Portainer Stacks +(Docker-compose)

We’re using MariaDB for our business because it’s meant for big business, and it’s my favorite database to use for small businesses. And I have a lot of skill experience with MariaDB than any other database, but few other databases are lacking in my experience. Therefore, I do not have sufficient time to undertake these experiences. After I document all my notes and work for sure, I will study these (MongoDB, PostgreSQL) I use some on app after I document all my notes and work for sure. I will study these after I document all my notes and work for sure. Which is a pain for me, but I got the app working and stable. So let get start to Tutorial for MariaDB.

Please ensure that you complete this first. Before starting build this,

How to set up Portainer with nginx Proxy Manager

We need to create a network for the MariaDB database for another app to communicate. We prefer to refrain from exposing our port.

docker network create mariadb

Now we can begin to create details for the MariaDB Database on Portainer.

 version: '2'
services:
  mariadb:
    container_name: mariadb
    networks:
      - mariadb
    image: mariadb
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=yourownpassword
      - MARIADB_AUTO_UPGRADE=1
      - MARIADB_DISABLE_UPGRADE_BACKUP=1
    volumes:
      - /mnt/nasdrive/mariadb/:/var/lib/mysql
networks:
  mariadb:
    external: true

Then you deploy the stacks. Your app will then be operational. Thereafter, you can easily add PhpMyAdmin to this docker-compose. But I like stacks because we can use the same app for many server databases.

OPTIONAL BONUS for PhpMyAdmin How to set up.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.