From 738b4da1382b94d1b52a982946137360f9b3c7d5 Mon Sep 17 00:00:00 2001 From: Sebastian Silva Date: Wed, 14 Feb 2018 01:43:27 -0500 Subject: [PATCH] Include mysql configuration file (supersedes #1428) --- config/my.cnf | 42 ++++++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 4 +++- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 config/my.cnf diff --git a/config/my.cnf b/config/my.cnf new file mode 100644 index 0000000000..62fa8cbe3f --- /dev/null +++ b/config/my.cnf @@ -0,0 +1,42 @@ +[mysqld] +skip-host-cache +skip-name-resolve +datadir = /var/lib/mysql + +# Plots specific +# To avoid single large file +innodb_file_per_table = 1 +# Replication +#server-id=2 +#log_bin = /var/lib/mysql/log/mysql-bin.log +#binlog_do_db = publiclab_production +# Persist socket +socket = /var/lib/mysql/mysqld.sock +pid-file = /var/lib/mysql/mysqld + +# master-host=172.17.0.1 +#replicate-do-db=publiclab_production +#relay-log=publiclab-relay-bin +#relay-log-index=publiclab-relay-bin.index + +# +# * Fine Tuning +# +key_buffer = 16M +max_allowed_packet = 16M +thread_stack = 192K +thread_cache_size = 8 +max_connections = 50 +wait_timeout = 60 +# +# * Query Cache Configuration +# +query_cache_limit = 1M +query_cache_size = 16M + +# Here you can see queries with especially long duration +slow-query-log = 1 +slow-query-log-file = /var/lib/mysql/log/mysql-slow.log +long_query_time = 5 + +!includedir /etc/mysql/conf.d/ diff --git a/docker-compose.yml b/docker-compose.yml index 809570360d..095c3fbd11 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: - MYSQL_PASSWORD=plots - MYSQL_RANDOM_ROOT_PASSWORD=true volumes: + - ./config/my.cnf:/etc/mysql/my.cnf + # for configuration - ../mysql:/var/lib/mysql # for persistence - ../dump:/docker-entrypoint-initdb.d @@ -25,4 +27,4 @@ services: - "127.0.0.1:4000:4000" links: - db -# restart: unless-stopped + restart: unless-stopped