1
- FROM ubuntu:14.04
1
+ FROM alpine
2
2
3
3
# ---------------- #
4
4
# Installation #
5
5
# ---------------- #
6
6
7
- ENV DEBIAN_FRONTEND noninteractive
8
-
9
7
# Install all prerequisites
10
- RUN apt-get -y update &&\
11
- apt-get -y install software-properties-common python-django-tagging python-simplejson \
12
- python-memcache python-ldap python-cairo python-pysqlite2 python-support python-pip \
13
- gunicorn supervisor nginx-light git wget curl openjdk-7-jre build-essential python-dev libffi-dev
14
-
15
- RUN pip install Twisted==13.2.0
16
- RUN pip install pytz
17
- RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
18
- RUN apt-get install -y nodejs
19
- RUN npm install -g wizzy
20
-
21
- # Checkout the stable branches of Graphite, Carbon and Whisper and install from there
22
- RUN mkdir /src
23
- RUN git clone https://github.com/graphite-project/whisper.git /src/whisper &&\
24
- cd /src/whisper &&\
25
- git checkout 1.0.x &&\
8
+ RUN apk add --update --no-cache nginx nodejs nodejs-npm git curl wget gcc ca-certificates \
9
+ python-dev py-pip musl-dev libffi-dev cairo supervisor bash \
10
+ py-pyldap py-rrd &&\
11
+ wget -q -O /etc/apk/keys/sgerrand.rsa.pub \
12
+ https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub &&\
13
+ wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.26-r0/glibc-2.26-r0.apk &&\
14
+ apk add --no-cache glibc-2.26-r0.apk &&\
15
+ rm glibc-2.26-r0.apk &&\
16
+ adduser -D -u 1000 -g 'www' www &&\
17
+ pip install -U pip pytz gunicorn six --no-cache-dir &&\
18
+ npm install -g wizzy &&\
19
+ npm cache clean --force
20
+
21
+ # Checkout the master branches of Graphite, Carbon and Whisper and install from there
22
+ RUN mkdir /src &&\
23
+ git clone --depth=1 --branch master https://github.com/graphite-project/whisper.git /src/whisper &&\
24
+ cd /src/whisper &&\
25
+ pip install . --no-cache-dir &&\
26
26
python setup.py install
27
27
28
- RUN git clone https://github.com/graphite-project/carbon.git /src/carbon &&\
29
- cd /src/carbon &&\
30
- git checkout 1.0.x &&\
28
+ RUN git clone --depth=1 --branch master https://github.com/graphite-project/carbon.git /src/carbon &&\
29
+ cd /src/carbon &&\
30
+ pip install . --no-cache-dir &&\
31
31
python setup.py install
32
32
33
-
34
- RUN git clone https://github.com/graphite-project/graphite-web.git /src/graphite-web &&\
35
- cd /src/graphite-web &&\
36
- git checkout 1.0.x &&\
37
- python setup.py install &&\
38
- pip install -r requirements.txt &&\
33
+ RUN git clone --depth=1 --branch master https://github.com/graphite-project/graphite-web.git /src/graphite-web &&\
34
+ cd /src/graphite-web &&\
35
+ pip install . --no-cache-dir &&\
36
+ python setup.py install &&\
37
+ pip install -r requirements.txt --no-cache-dir &&\
39
38
python check-dependencies.py
40
39
41
40
# Install StatsD
42
- RUN git clone https://github.com/etsy/statsd.git /src/statsd &&\
43
- cd /src/statsd &&\
44
- git checkout v0.8.0
45
-
41
+ RUN git clone --depth=1 --branch master https://github.com/etsy/statsd.git /src/statsd
46
42
47
43
# Install Grafana
48
- RUN mkdir /src/grafana &&\
49
- mkdir /opt/grafana &&\
50
- wget https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.4.3.linux-x64.tar.gz -O /src/grafana.tar.gz &&\
51
- tar -xzf /src/grafana.tar.gz -C /opt/grafana --strip-components=1 &&\
44
+ RUN mkdir /src/grafana &&\
45
+ mkdir /opt/grafana &&\
46
+ curl https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana-4.6.1.linux-x64.tar.gz \
47
+ -o /src/grafana.tar.gz &&\
48
+ tar -xzf /src/grafana.tar.gz -C /opt/grafana --strip-components=1 &&\
52
49
rm /src/grafana.tar.gz
53
50
54
51
52
+ # Cleanup Compile Dependencies
53
+ RUN apk del --no-cache git curl wget gcc python-dev musl-dev libffi-dev
54
+
55
+
55
56
# ----------------- #
56
57
# Configuration #
57
58
# ----------------- #
@@ -65,30 +66,33 @@ ADD ./graphite/local_settings.py /opt/graphite/webapp/graphite/local_setting
65
66
ADD ./graphite/carbon.conf /opt/graphite/conf/carbon.conf
66
67
ADD ./graphite/storage-schemas.conf /opt/graphite/conf/storage-schemas.conf
67
68
ADD ./graphite/storage-aggregation.conf /opt/graphite/conf/storage-aggregation.conf
68
- RUN mkdir -p /opt/graphite/storage/whisper
69
- RUN touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index
70
- RUN chown -R www-data /opt/graphite/storage
71
- RUN chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper
72
- RUN chmod 0664 /opt/graphite/storage/graphite.db
73
- RUN cp /src/graphite-web/webapp/manage.py /opt/graphite/webapp
74
- RUN cd /opt/graphite/webapp/ && python manage.py migrate --run-syncdb --noinput
69
+ RUN mkdir -p /opt/graphite/storage/whisper &&\
70
+ touch /opt/graphite/storage/graphite.db /opt/graphite/storage/index &&\
71
+ chown -R www /opt/graphite/storage &&\
72
+ chmod 0775 /opt/graphite/storage /opt/graphite/storage/whisper &&\
73
+ chmod 0664 /opt/graphite/storage/graphite.db &&\
74
+ cp /src/graphite-web/webapp/manage.py /opt/graphite/webapp &&\
75
+ cd /opt/graphite/webapp/ && python manage.py migrate --run-syncdb --noinput
75
76
76
77
# Configure Grafana and wizzy
77
78
ADD ./grafana/custom.ini /opt/grafana/conf/custom.ini
78
- RUN cd /src && wizzy init &&\
79
- extract() { cat /opt/grafana/conf/custom.ini | grep $1 | awk '{print $NF}' ; } &&\
80
- wizzy set grafana url $(extract ";protocol" )://$(extract ";domain" ):$(extract ";http_port" ) &&\
81
- wizzy set grafana username $(extract ";admin_user" ) &&\
82
- wizzy set grafana password $(extract ";admin_password" )
79
+ RUN cd /src &&\
80
+ wizzy init &&\
81
+ extract() { cat /opt/grafana/conf/custom.ini | grep $1 | awk '{print $NF}' ; } &&\
82
+ wizzy set grafana url $(extract ";protocol" )://$(extract ";domain" ):$(extract ";http_port" ) &&\
83
+ wizzy set grafana username $(extract ";admin_user" ) &&\
84
+ wizzy set grafana password $(extract ";admin_password" )
85
+
83
86
# Add the default datasource and dashboards
84
- RUN mkdir /src/datasources
85
- ADD ./grafana/datasources/* /src/datasources
86
- RUN mkdir /src/dashboards
87
+ RUN mkdir /src/datasources &&\
88
+ mkdir /src/dashboards
89
+ ADD ./grafana/datasources/* /src/datasources
87
90
ADD ./grafana/dashboards/* /src/dashboards/
88
91
ADD ./grafana/export-datasources-and-dashboards.sh /src/
89
92
90
93
# Configure nginx and supervisord
91
94
ADD ./nginx/nginx.conf /etc/nginx/nginx.conf
95
+ RUN mkdir /var/log/supervisor
92
96
ADD ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
93
97
94
98
@@ -108,11 +112,12 @@ EXPOSE 8126
108
112
# Graphite web port
109
113
EXPOSE 81
110
114
115
+ # Graphite Carbon port
116
+ EXPOSE 2003
111
117
112
118
113
119
# -------- #
114
120
# Run! #
115
121
# -------- #
116
122
117
- CMD ["/usr/bin/supervisord" ]
118
-
123
+ CMD ["/usr/bin/supervisord" , "--nodaemon" , "--configuration" , "/etc/supervisor/conf.d/supervisord.conf" ]
0 commit comments