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"]