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

MariaDB is our favorite database to use for small business, and it meant for big business, so we’re using MariaDB for our business to keep growing. And I have a lot of skill experience with MariaDB than any database, but few other databases in my experience is lack. So, I don’t have time to do experience these. After I document all my notes and work for sure, I will study these (MongoDB, PostgreSQL) these I use some on app… Which is a pain for me, but I got the app working and stable. So let get start to Tutorial for MariaDB.

Make sure you do this first! Before starting build this,

How to set up Portainer with nginx Proxy Manager Applegate’s IT and Network (x4-applegate.com)

Then We need to create a Network for MariaDB Database for another app to communicate, again. We would rather not expose our port!

docker network create mariadb

Then Now we can start to build stack detail for 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 start deploying the stacks. And your app will be up running. Then you can add PhpMyAdmin to this docker-compose effortless. But I like separate stacks because, again, we can use one app for many databases.

OPTIONAL BONUS for PhpMyAdmin How to set up.


Comments

Leave a Reply

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