Add mariadb timezone setting via WORKSPACE_TIMEZONE in .env

This commit is contained in:
anribras 2019-07-06 17:41:11 +08:00
parent a2c7b46766
commit f8ec06ac1c
2 changed files with 8 additions and 0 deletions

View File

@ -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}

View File

@ -2,6 +2,13 @@ FROM mariadb:latest
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
#####################################
# 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"]