forked from lblanc/grafana-integration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
executable file
·98 lines (79 loc) · 2.57 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
93
94
95
96
97
98
FROM debian:10
MAINTAINER Luc Blanc <email@luc-blanc.com>
ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.UTF-8
# Database Defaults
ENV INFLUXDB_GRAFANA_DB datasource
ENV INFLUXDB_GRAFANA_USER datasource
ENV INFLUXDB_GRAFANA_PW datasource
ENV MYSQL_GRAFANA_USER grafana
ENV MYSQL_GRAFANA_PW grafana
# Copy files for DataCore
COPY datacore/* /etc/datacore/
# Base dependencies
RUN mkdir /data-docker && mkdir /data-docker/mysql && mkdir /data-docker/influxdb && \
ln -s /data-docker/mysql /var/lib/mysql && ln -s /data-docker/influxdb /var/lib/influxdb && \
chmod 777 /data-docker/influxdb && \
chmod 777 /var/lib/influxdb && \
rm /var/lib/apt/lists/* -vf && \
apt-get -y update && \
apt-get -y dist-upgrade && \
apt-get -y --allow-downgrades install \
apt-utils \
ca-certificates \
curl \
git \
htop \
libfontconfig \
default-mysql-client \
default-mysql-server \
nano \
gnupg2 \
gnupg1 \
gnupg \
net-tools \
openssh-server \
vim \
supervisor \
apt-transport-https \
python-configparser \
python-concurrent.futures \
python-requests \
cron \
influxdb \
wget && \
#curl -sL https://deb.nodesource.com/setup_9.x | bash - && \
#apt-get install -y nodejs &&\
echo "deb https://packages.grafana.com/oss/deb stable main" > /etc/apt/sources.list.d/grafana.list &&\
wget https://packages.grafana.com/gpg.key &&\
apt-key add gpg.key &&\
apt-get update &&\
apt-get install grafana && \
wget https://repos.influxdata.com/influxdb.key && \
apt-key add influxdb.key && \
echo "deb https://repos.influxdata.com/debian buster stable" | tee /etc/apt/sources.list.d/influxdb.list && \
apt-get update && \
apt-get install telegraf chronograf
# Configure Supervisord, SSH, base env, cron and MySql
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
WORKDIR /root
RUN mkdir -p /var/log/supervisor && \
mkdir -p /var/run/sshd && \
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \
echo 'root:root' | chpasswd && \
cat /etc/datacore/datacore-cron >> /etc/crontab && \
/etc/datacore/setup_mysql.sh && \
chmod +x /etc/datacore/config.sh
# Configure InfluxDB
COPY influxdb/init.sh /etc/init.d/influxdb
# Configure Telegraf
COPY telegraf/telegraf.conf /etc/telegraf/telegraf.conf
COPY telegraf/init.sh /etc/init.d/telegraf
# Configure Grafana
COPY grafana/grafana.ini /etc/grafana/grafana.ini
# Cleanup
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME [ "/data" ]
ENTRYPOINT [ "/etc/datacore/config.sh" ]
CMD [ "/usr/bin/supervisord" ]