Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support changing timezone using env #48

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM phusion/baseimage:0.9.18
MAINTAINER Nathan Hopkins <[email protected]>

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
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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\
Expand Down
4 changes: 3 additions & 1 deletion daemons/graphite.sh
Original file line number Diff line number Diff line change
@@ -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