-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
92 lines (71 loc) · 2.51 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
FROM ubuntu:18.04
ENV GRAFANA_VERSION 5.1.3
ENV INFLUXDB_VERSION 1.5.3
ENV CHRONOGRAF_VERSION 1.5.0.1
# Prevent some error messages
ENV DEBIAN_FRONTEND noninteractive
# ---------------- #
# Installation #
# ---------------- #
# Install all prerequisites
RUN apt-get -y update && apt-get -y upgrade && \
apt-get -y install wget nginx-light supervisor curl adduser libfontconfig
# Install Grafana
RUN wget -nv https://s3-us-west-2.amazonaws.com/grafana-releases/release/grafana_${GRAFANA_VERSION}_amd64.deb && \
dpkg -i grafana_${GRAFANA_VERSION}_amd64.deb && rm grafana_${GRAFANA_VERSION}_amd64.deb
# Install InfluxDB
RUN wget -nv https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
dpkg -i influxdb_${INFLUXDB_VERSION}_amd64.deb && rm influxdb_${INFLUXDB_VERSION}_amd64.deb
# Install Chronograf
RUN wget -nv https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
dpkg -i chronograf_${CHRONOGRAF_VERSION}_amd64.deb && rm chronograf_${CHRONOGRAF_VERSION}_amd64.deb
# ----------------- #
# Configuration #
# ----------------- #
# Configure InfluxDB
ADD influxdb/config.toml /etc/influxdb/config.toml
ADD influxdb/run.sh /usr/local/bin/run_influxdb
# These two databases have to be created. These variables are used by set_influxdb.sh and set_grafana.sh
ENV PRE_CREATE_DB data grafana
ENV INFLUXDB_HOST localhost:8086
ENV INFLUXDB_DATA_USER data
ENV INFLUXDB_DATA_PW data
ENV INFLUXDB_GRAFANA_USER grafana
ENV INFLUXDB_GRAFANA_PW grafana
ENV ROOT_PW root
# Configure Grafana
ADD ./grafana/config.ini /etc/grafana/config.ini
ADD grafana/run.sh /usr/local/bin/run_grafana
ADD ./configure.sh /configure.sh
ADD ./set_grafana.sh /set_grafana.sh
ADD ./set_influxdb.sh /set_influxdb.sh
RUN /configure.sh
# Configure Chronograf
ENV INFLUXDB_URL http://${INFLUXDB_HOST}
ENV INFLUXDB_USERNAME ${INFLUXDB_DATA_USER}
ENV INFLUXDB_PASSWORD ${INFLUXDB_DATA_PW}
ENV PUBLIC_URL http://localhost:8888
# Configure nginx and supervisord
ADD ./nginx/nginx.conf /etc/nginx/nginx.conf
ADD ./supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# ----------- #
# Cleanup #
# ----------- #
RUN apt-get autoremove -y wget curl && \
apt-get -y clean && \
rm -rf /var/lib/apt/lists/* && rm /*.sh
# ---------------- #
# Expose Ports #
# ---------------- #
# Grafana
EXPOSE 3000
# Chronograf
EXPOSE 8888
# InfluxDB HTTP API
EXPOSE 8086
# InfluxDB HTTPS API
EXPOSE 8084
# -------- #
# Run! #
# -------- #
CMD ["/usr/bin/supervisord"]