From f8ec06ac1cd32aee0f5083fe847b6b510c04fa02 Mon Sep 17 00:00:00 2001 From: anribras Date: Sat, 6 Jul 2019 17:41:11 +0800 Subject: [PATCH] Add mariadb timezone setting via WORKSPACE_TIMEZONE in .env --- docker-compose.yml | 1 + mariadb/Dockerfile | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/docker-compose.yml b/docker-compose.yml index a136f741..49a4c3a9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -407,6 +407,7 @@ services: ports: - "${MARIADB_PORT}:3306" environment: + - TZ=${WORKSPACE_TIMEZONE} - MYSQL_DATABASE=${MARIADB_DATABASE} - MYSQL_USER=${MARIADB_USER} - MYSQL_PASSWORD=${MARIADB_PASSWORD} diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile index 0dcb9481..7538b4e2 100644 --- a/mariadb/Dockerfile +++ b/mariadb/Dockerfile @@ -2,6 +2,13 @@ FROM mariadb:latest LABEL maintainer="Mahmoud Zalt " +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/ COPY my.cnf /etc/mysql/conf.d/my.cnf CMD ["mysqld"]