diff --git a/Dockerfile b/Dockerfile index 2adf4eb..8a30bcd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,8 @@ FROM phusion/baseimage:0.9.18 MAINTAINER Nathan Hopkins +ENV TZ="America/Los_Angeles" + #RUN echo deb http://archive.ubuntu.com/ubuntu $(lsb_release -cs) main universe > /etc/apt/sources.list.d/universe.list RUN apt-get -y update\ && apt-get -y upgrade diff --git a/README.md b/README.md index 923a644..77d4ccf 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,14 @@ That's it, you're done ... almost. * [Carbon](http://graphite.readthedocs.org/en/latest/carbon-daemons.html) - back-end * [Statsd](https://github.com/etsy/statsd/wiki) - UDP based back-end proxy +### Timezone support + +It is possible to set the timezone using the environment variable `'TZ'`. + + -e TZ='America/Los_Angeles' + +This affects both the operating system itself and the Graphite web application. + ### Mapped Ports Host | Container | Service @@ -43,6 +51,7 @@ Host | Container | Service docker run -d\ --name graphite\ --restart=always\ + -e TZ="America/Los_Angeles" -p 80:80\ -p 2003-2004:2003-2004\ -p 2023-2024:2023-2024\ diff --git a/daemons/graphite.sh b/daemons/graphite.sh index fc1f87b..d52851f 100755 --- a/daemons/graphite.sh +++ b/daemons/graphite.sh @@ -1,4 +1,6 @@ #!/bin/bash -/usr/bin/python /opt/graphite/webapp/graphite/manage.py runfcgi daemonize=false host=127.0.0.1 port=8080 +# Set timezone for Graphite-Web +sed -i "s~#\?TIME_ZONE = '.*'~TIME_ZONE = '${TZ}'~" /opt/graphite/webapp/graphite/local_settings.py +/usr/bin/python /opt/graphite/webapp/graphite/manage.py runfcgi daemonize=false host=127.0.0.1 port=8080 \ No newline at end of file