From 4ce0b536993dd9c5338faac57e5666b86bee2da6 Mon Sep 17 00:00:00 2001 From: Thomas Vanbesien Date: Thu, 18 Dec 2025 22:53:17 +0100 Subject: [PATCH] WIP --- docker-compose.yaml | 2 ++ services/mariadb/init.sql | 7 ++++++ services/mariadb/my.cnf | 40 +++++++++++++++++++++++++++++++++++ services/nextcloud/Dockerfile | 3 +++ services/nextcloud/mysql.ini | 16 ++++++++++++++ 5 files changed, 68 insertions(+) create mode 100644 services/mariadb/init.sql create mode 100644 services/mariadb/my.cnf create mode 100644 services/nextcloud/Dockerfile create mode 100644 services/nextcloud/mysql.ini diff --git a/docker-compose.yaml b/docker-compose.yaml index f878d41..b71d533 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -60,6 +60,8 @@ services: nextcloud: image: nextcloud:31-fpm + build: + context: ./services/nextcloud environment: - MYSQL_HOST=nextcloud-db - MYSQL_PASSWORD=pswd diff --git a/services/mariadb/init.sql b/services/mariadb/init.sql new file mode 100644 index 0000000..17485bb --- /dev/null +++ b/services/mariadb/init.sql @@ -0,0 +1,7 @@ +CREATE USER 'nextcloud'@'localhost' IDENTIFIED BY 'password'; +CREATE DATABASE nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; +GRANT ALL PRIVILEGES on nextcloud.* to 'nextcloud'@'localhost'; + +CREATE USER 'gitea'@'localhost' IDENTIFIED BY 'password'; +CREATE DATABASE gitea CHARACTER SET utf8mb4 COLLATE utf8mb4_bin; +GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost'; diff --git a/services/mariadb/my.cnf b/services/mariadb/my.cnf new file mode 100644 index 0000000..c328943 --- /dev/null +++ b/services/mariadb/my.cnf @@ -0,0 +1,40 @@ +[mariadb] +host-cache-size = 128 +skip-name-resolve = true + +[mysqld] +transaction_isolation = READ-COMMITTED +binlog_format = ROW + +[server] +skip_name_resolve = 1 +innodb_buffer_pool_size = 128M +innodb_buffer_pool_instances = 1 +innodb_flush_log_at_trx_commit = 2 +innodb_log_buffer_size = 32M +innodb_max_dirty_pages_pct = 90 +query_cache_type = 1 +query_cache_limit = 2M +query_cache_min_res_unit = 2k +query_cache_size = 64M +tmp_table_size= 64M +max_heap_table_size= 64M +slow_query_log = 1 +slow_query_log_file = /var/log/mysql/slow.log +long_query_time = 1 + +[client-server] +!includedir /etc/mysql/conf.d/ +!includedir /etc/mysql/mariadb.conf.d/ + +[client] +default-character-set = utf8mb4 + +[mysqld] +character_set_server = utf8mb4 +collation_server = utf8mb4_general_ci +transaction_isolation = READ-COMMITTED +binlog_format = ROW +innodb_large_prefix=on +innodb_file_format=barracuda +innodb_file_per_table=1 diff --git a/services/nextcloud/Dockerfile b/services/nextcloud/Dockerfile new file mode 100644 index 0000000..c0b198e --- /dev/null +++ b/services/nextcloud/Dockerfile @@ -0,0 +1,3 @@ +FROM nextcloud:31-fpm + +COPY ./mysql.ini /usr/local/etc/php/conf.d/mysql.ini diff --git a/services/nextcloud/mysql.ini b/services/nextcloud/mysql.ini new file mode 100644 index 0000000..a3500bc --- /dev/null +++ b/services/nextcloud/mysql.ini @@ -0,0 +1,16 @@ +# configuration for PHP MySQL module +extension=pdo_mysql.so + +[mysql] +mysql.allow_local_infile=On +mysql.allow_persistent=On +mysql.cache_size=2000 +mysql.max_persistent=-1 +mysql.max_links=-1 +mysql.default_port= +mysql.default_socket=/var/lib/mysql/mysql.sock # Debian squeeze: /var/run/mysqld/mysqld.sock +mysql.default_host= +mysql.default_user= +mysql.default_password= +mysql.connect_timeout=60 +mysql.trace_mode=Off