From 6eaf587803a8eb2957fc67ff68dafbab1cd387ad Mon Sep 17 00:00:00 2001 From: anribras Date: Sun, 14 Jul 2019 11:41:12 +0800 Subject: [PATCH] Add mariadb timezone setting via WORKSPACE_TIMEZONE in .env (#2197) --- 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"]