1
- FROM ubuntu:14.04
2
- RUN apt-get -y update
3
- RUN apt-get -y upgrade
4
-
1
+ FROM ubuntu:14.04.1
5
2
6
3
# ---------------- #
7
4
# Installation #
@@ -14,47 +11,43 @@ RUN apt-get -y update
14
11
RUN apt-get -y install python-django-tagging python-simplejson python-memcache python-ldap python-cairo python-pysqlite2 python-support \
15
12
python-pip gunicorn supervisor nginx-light nodejs git wget curl openjdk-7-jre build-essential python-dev
16
13
17
- # Install Elasticsearch
18
- RUN cd ~ && wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb
19
- RUN cd ~ && dpkg -i elasticsearch-1.3.2.deb && rm elasticsearch-1.3.2.deb
20
-
21
- # Install Whisper, Carbon and Graphite-Web
22
14
RUN pip install Twisted==11.1.0
23
15
RUN pip install Django==1.5
24
- RUN pip install whisper==0.9.12
25
- RUN pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/lib" carbon==0.9.12
26
- RUN pip install --install-option="--prefix=/var/lib/graphite" --install-option="--install-lib=/var/lib/graphite/webapp" graphite-web==0.9.12
27
16
28
17
18
+ # Install Elasticsearch
19
+ RUN cd ~ && wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.3.2.deb
20
+ RUN cd ~ && dpkg -i elasticsearch-1.3.2.deb && rm elasticsearch-1.3.2.deb
29
21
30
- # --------------------------------------- #
31
- # Install & Patch StatsD and Grafana #
32
- # --------------------------------------- #
22
+ # Checkout the stable branches of Graphite, Carbon and Whisper and install from there
23
+ RUN mkdir /src
24
+ RUN git clone https://github.com/graphite-project/whisper.git /src/whisper &&\
25
+ cd /src/whisper &&\
26
+ git checkout 0.9.x &&\
27
+ python setup.py install
33
28
34
- # We are patching StatsD and Grafana to play nice with url-encoded metric names, that makes the dashboard more usable when displaying
35
- # metrics names for actors, http traces and dispatchers.
29
+ RUN git clone https://github.com/graphite-project/carbon.git /src/carbon &&\
30
+ cd /src/carbon &&\
31
+ git checkout 0.9.x &&\
32
+ python setup.py install
36
33
37
- # Install & Patch StatsD
38
- RUN mkdir /src &&\
39
- git clone https://github.com/etsy/statsd.git /src/statsd &&\
40
- cd /src/statsd &&\
41
- git checkout v0.7.2 &&\
42
- sed -i -e "s|.replace(/\[ ^a-zA-Z_\\\\ -0-9\\\\ .]/g, '');|.replace(/[^a-zA-Z_\\\\ -0-9\\\\ .\\\\ %]/g, '');|" /src/statsd/stats.js
43
34
35
+ RUN git clone https://github.com/graphite-project/graphite-web.git /src/graphite-web &&\
36
+ cd /src/graphite-web &&\
37
+ git checkout 0.9.x &&\
38
+ python setup.py install
44
39
45
- # Install & Patch Grafana
46
- RUN mkdir /src/grafana &&\
47
- git clone https://github.com/grafana/grafana.git /src/grafana &&\
48
- cd /src/grafana &&\
49
- git checkout v1.7.0
40
+ # Install StatsD
41
+ RUN git clone https://github.com/etsy/statsd.git /src/statsd &&\
42
+ cd /src/statsd &&\
43
+ git checkout v0.7.2
50
44
51
- ADD ./grafana/correctly-show-urlencoded-metrics.patch /src/grafana/correctly-show-urlencoded-metrics.patch
52
- RUN git apply /src/grafana/correctly-show-urlencoded-metrics.patch --directory=/src/grafana &&\
53
- cd /src/grafana &&\
54
- npm install &&\
55
- npm install -g grunt-cli &&\
56
- grunt build
57
45
46
+ # Install Grafana
47
+ RUN mkdir /src/grafana
48
+ RUN wget http://grafanarel.s3.amazonaws.com/grafana-1.9.1.tar.gz -O /src/grafana.tar.gz &&\
49
+ tar -xzf /src/grafana.tar.gz -C /src/grafana --strip-components=1 &&\
50
+ rm /src/grafana.tar.gz
58
51
59
52
60
53
# ----------------- #
@@ -70,28 +63,30 @@ RUN mkdir -p /tmp/elasticsearch && chown elasticsearch:elasticsearch /tmp/el
70
63
ADD ./statsd/config.js /src/statsd/config.js
71
64
72
65
# Configure Whisper, Carbon and Graphite-Web
73
- ADD ./graphite/initial_data.json /var/lib /graphite/webapp/graphite/initial_data.json
74
- ADD ./graphite/local_settings.py /var/lib /graphite/webapp/graphite/local_settings.py
75
- ADD ./graphite/carbon.conf /var/lib /graphite/conf/carbon.conf
76
- ADD ./graphite/storage-schemas.conf /var/lib /graphite/conf/storage-schemas.conf
77
- ADD ./graphite/storage-aggregation.conf /var/lib /graphite/conf/storage-aggregation.conf
78
- RUN mkdir -p /var/lib /graphite/storage/whisper
79
- RUN touch /var/lib/ graphite/storage/graphite.db /var/lib /graphite/storage/index
80
- RUN chown -R www-data /var/lib /graphite/storage
81
- RUN chmod 0775 /var/lib/ graphite/storage /var/lib /graphite/storage/whisper
82
- RUN chmod 0664 /var/lib /graphite/storage/graphite.db
83
- RUN cd /var/lib /graphite/webapp/graphite && python manage.py syncdb --noinput
66
+ ADD ./graphite/initial_data.json /opt /graphite/webapp/graphite/initial_data.json
67
+ ADD ./graphite/local_settings.py /opt /graphite/webapp/graphite/local_settings.py
68
+ ADD ./graphite/carbon.conf /opt /graphite/conf/carbon.conf
69
+ ADD ./graphite/storage-schemas.conf /opt /graphite/conf/storage-schemas.conf
70
+ ADD ./graphite/storage-aggregation.conf /opt /graphite/conf/storage-aggregation.conf
71
+ RUN mkdir -p /opt /graphite/storage/whisper
72
+ RUN touch /opt/ graphite/storage/graphite.db /opt /graphite/storage/index
73
+ RUN chown -R www-data /opt /graphite/storage
74
+ RUN chmod 0775 /opt/ graphite/storage /opt /graphite/storage/whisper
75
+ RUN chmod 0664 /opt /graphite/storage/graphite.db
76
+ RUN cd /opt /graphite/webapp/graphite && python manage.py syncdb --noinput
84
77
85
78
# Configure Grafana
86
- ADD ./grafana/config.js /src/grafana/dist/config.js
87
- ADD ./grafana/default-dashboard.json /src/grafana/dist/app/dashboards/default.json
79
+ ADD ./grafana/config.js /src/grafana/config.js
80
+
81
+ # Add the default dashboards
82
+ RUN mkdir /src/dashboards
83
+ ADD ./grafana/dashboards/* /src/dashboards/
88
84
89
85
# Configure nginx and supervisord
90
86
ADD ./nginx/nginx.conf /etc/nginx/nginx.conf
91
87
ADD ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
92
88
93
89
94
-
95
90
# ---------------- #
96
91
# Expose Ports #
97
92
# ---------------- #
@@ -107,7 +102,6 @@ EXPOSE 8126
107
102
108
103
109
104
110
-
111
105
# -------- #
112
106
# Run! #
113
107
# -------- #
0 commit comments