diff --git a/Dockerfile b/Dockerfile index b7bef93..44bf191 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,8 @@ RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -q -y cron sudo automysqlbackup COPY mysql.cnf /etc/mysql/mariadb.conf.d/settings.cnf -RUN chown mysql:mysql /etc/mysql/mariadb.conf.d/settings.cnf +COPY custom.cnf /etc/mysql/mariadb.conf.d/custom.cnf +RUN chown mysql:mysql /etc/mysql/mariadb.conf.d/custom.cnf COPY docker-entrypoint.sh /usr/local/bin/ COPY healthcheck.sh /usr/local/bin/ COPY automysqlbackup /etc/default diff --git a/custom.cnf b/custom.cnf new file mode 100644 index 0000000..55797f5 --- /dev/null +++ b/custom.cnf @@ -0,0 +1,4 @@ +[mysqld] +server_id=33 +replicate-do-db= +read-only \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 4b502e8..73f0979 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -330,13 +330,14 @@ if ! _is_sourced; then SERVER_ID=${SERVER_ID:-33} READONLY=${READONLY:-1} - cat >>/etc/mysql/mariadb.conf.d/settings.cnf </etc/mysql/mariadb.conf.d/custom.cnf <> /etc/mysql/mariadb.conf.d/settings.cnf + echo "read-only" >> /etc/mysql/mariadb.conf.d/custom.cnf fi sudo service cron start