This commit is contained in:
2025-12-19 17:29:18 +01:00
parent 3c23f3d8d5
commit da759b8116
7 changed files with 95 additions and 41 deletions

View File

@@ -0,0 +1,4 @@
FROM mariadb:11.4
COPY ./init.sql /docker-entrypoint-initdb.d/init.sql
COPY ./my.cnf /etc/mysql/conf.d/my.cnf

View File

@@ -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';

40
services/mariadb/my.cnf Normal file
View File

@@ -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

View File

@@ -0,0 +1,3 @@
FROM nextcloud:31-fpm
COPY ./mysql.ini /usr/local/etc/php/conf.d/mysql.ini

View File

@@ -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

View File

@@ -20,7 +20,7 @@ server {
server {
listen 443 ssl;
server_name openproject.yourdomain.com;
server_name openproject.localhost;
ssl_certificate /etc/ssl/crt/server.crt;
ssl_certificate_key /etc/ssl/crt/server.key;
@@ -40,7 +40,7 @@ server {
server {
listen 443 ssl;
server_name gitea.yourdomain.com;
server_name gitea.localhost;
ssl_certificate /etc/ssl/crt/server.crt;
ssl_certificate_key /etc/ssl/crt/server.key;
@@ -61,7 +61,7 @@ server {
# https://github.com/nextcloud/docker/blob/master/.examples/docker-compose/with-nginx-proxy/mariadb/fpm/web/nginx.conf
server {
listen 443 ssl;
server_name nextcloud.yourdomain.com;
server_name nextcloud.localhost;
ssl_certificate /etc/ssl/crt/server.crt;
ssl_certificate_key /etc/ssl/crt/server.key;