forked from alhazmy13/Synology-NAS-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
109 lines (85 loc) · 2.96 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
99
100
101
102
103
104
105
106
107
108
109
FROM ubuntu:20.04
LABEL maintainer="me and only me"
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
#ENV TZ=Europe/Tallinn
# Default versions
ENV TELEGRAF_VERSION 1.16.3-1
ENV INFLUXDB_VERSION 1.8.3
#ENV GRAFANA_VERSION 8.3.5
ENV CHRONOGRAF_VERSION 1.8.9.1
ENV GF_DATABASE_TYPE=sqlite3
# Fix bad proxy issue
#COPY system/99fixbadproxy /etc/apt/apt.conf.d/99fixbadproxy
# Clear previous sources
RUN rm /var/lib/apt/lists/* -vf
# Base dependencies
RUN apt-get -y update && \
apt-get -y dist-upgrade && \
apt-get -y install \
apt-utils \
ca-certificates \
curl \
git \
htop \
libfontconfig \
mc \
net-tools \
openssh-server \
supervisor \
gnupg \
gnupg2 \
gnupg1 \
snmp \
snmp-mibs-downloader \
wget && \
curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
apt-get install -y nodejs
# Configure Supervisord, SSH and base env
COPY supervisord/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
WORKDIR /root
RUN mkdir -p /var/log/supervisor && \
mkdir -p /var/run/sshd && \
echo 'root:root' | chpasswd && \
rm -rf .ssh && \
rm -rf .profile && \
mkdir .ssh
COPY ssh/id_rsa .ssh/id_rsa
COPY bash/profile .profile
# Install InfluxDB
RUN wget https://dl.influxdata.com/influxdb/releases/influxdb_${INFLUXDB_VERSION}_amd64.deb && \
dpkg -i influxdb_${INFLUXDB_VERSION}_amd64.deb && rm influxdb_${INFLUXDB_VERSION}_amd64.deb
# Configure InfluxDB
COPY influxdb/influxdb.conf /etc/influxdb/influxdb.conf
COPY influxdb/init.sh /etc/init.d/influxdb
# Install Telegraf
RUN wget https://dl.influxdata.com/telegraf/releases/telegraf_${TELEGRAF_VERSION}_amd64.deb && \
dpkg -i telegraf_${TELEGRAF_VERSION}_amd64.deb && rm telegraf_${TELEGRAF_VERSION}_amd64.deb
# Configure Telegraf
RUN mv -f /etc/telegraf/telegraf.conf /etc/telegraf/telegraf.conf.default
COPY telegraf/telegraf.conf /etc/telegraf/telegraf.conf
COPY telegraf/init.sh /etc/init.d/telegraf
# Install Chronograf
RUN wget https://dl.influxdata.com/chronograf/releases/chronograf_${CHRONOGRAF_VERSION}_amd64.deb && \
dpkg -i chronograf_${CHRONOGRAF_VERSION}_amd64.deb && rm chronograf_${CHRONOGRAF_VERSION}_amd64.deb
# Install Grafana
#RUN wget https://dl.grafana.com/oss/release/grafana_${GRAFANA_VERSION}_amd64.deb && \
# dpkg -i grafana_${GRAFANA_VERSION}_amd64.deb && rm grafana_${GRAFANA_VERSION}_amd64.deb
# Configure Grafana with provisioning
#ADD grafana/provisioning /etc/grafana/provisioning
#COPY grafana/grafana.ini /etc/grafana/grafana.ini
# Synology SNMP
COPY synology/synology.conf /etc/telegraf/telegraf.d
COPY synology/Synology_MIB_File.tar.gz /tmp
RUN tar -xvzf /tmp/Synology_MIB_File.tar.gz -C /usr/share/snmp/mibs
RUN chown root:root /usr/share/snmp/mibs
RUN chmod 755 /usr/share/snmp/mibs
# Install plugins
#COPY rootfs /tmp
#RUN /tmp/grafana-plugins.sh
EXPOSE 22/tcp 8086/tcp 8888/tcp 8125/udp
#VOLUME /var/lib/influxdb /var/lib/grafana /var/lib/backups
# Cleanup
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
CMD ["/usr/bin/supervisord"]