Switched to building an image localy instead of using one from docker hub

Added database folder
Created Dockerfile and config for mariadb image
Moved data folder tp database/data/
This commit is contained in:
StNicolay 2022-12-15 15:13:39 +00:00
parent a9417058ee
commit c2eca49933
5 changed files with 47 additions and 4 deletions

View File

@ -24,5 +24,5 @@
**/secrets.dev.yaml **/secrets.dev.yaml
**/values.dev.yaml **/values.dev.yaml
README.md README.md
data/ database/
.flake8 .flake8

2
.gitignore vendored
View File

@ -161,4 +161,4 @@ cython_debug/
#.idea/ #.idea/
# Database data # Database data
data/ database/data/

View File

@ -20,7 +20,9 @@ services:
- password_manager - password_manager
db: db:
image: stnicolay/mariadb-aria build:
context: ./database/
dockerfile: ./Dockerfile
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: example123! MYSQL_ROOT_PASSWORD: example123!
@ -28,6 +30,6 @@ services:
MYSQL_USER: manager MYSQL_USER: manager
MYSQL_PASSWORD: passwd123! MYSQL_PASSWORD: passwd123!
volumes: volumes:
- ./data:/var/lib/mysql - ./database/data:/var/lib/mysql
networks: networks:
- password_manager - password_manager

3
database/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM mariadb
COPY mariadb.cnf /etc/mysql/mariadb.cnf

38
database/mariadb.cnf Normal file
View File

@ -0,0 +1,38 @@
# The MariaDB configuration file
#
# The MariaDB/MySQL tools read configuration files in the following order:
# 0. "/etc/mysql/my.cnf" symlinks to this file, reason why all the rest is read.
# 1. "/etc/mysql/mariadb.cnf" (this file) to set global defaults,
# 2. "/etc/mysql/conf.d/*.cnf" to set global options.
# 3. "/etc/mysql/mariadb.conf.d/*.cnf" to set MariaDB-only options.
# 4. "~/.my.cnf" to set user-specific options.
#
# If the same option is defined multiple times, the last one will apply.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
#
# If you are new to MariaDB, check out https://mariadb.com/kb/en/basic-mariadb-articles/
#
# This group is read both by the client and the server
# use it for options that affect everything
#
[client-server]
# Port or socket location where to connect
# port = 3306
socket = /run/mysqld/mysqld.sock
# Import all .cnf files from configuration directory
[mariadbd]
skip-host-cache
skip-name-resolve
[mysqld]
skip-innodb
default-storage-engine=Aria
default-tmp-storage-engine=Aria
!includedir /etc/mysql/mariadb.conf.d/
!includedir /etc/mysql/conf.d/