blob: 9f0dfd671f318fbedbaafc47579b21883bce1d3d (
plain)
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
110
111
112
113
114
115
116
117
118
119
|
@template nms-base
FROM debian:jessie
ENV container docker
MAINTAINER "Kristian" <kly@kly.no>
#RUN systemctl set-default basic.target
RUN apt-get update && apt-get -y install \
wget \
vim \
man \
build-essential \
net-tools \
bash-completion \
git-core \
autoconf \
netcat \
libwww-perl \
libmicrohttpd-dev \
libcurl4-gnutls-dev \
libedit-dev \
libpcre3-dev \
libncurses5-dev \
python-demjson \
python-docutils \
libtool \
nodejs \
httpie \
locales \
screen \
openssh-server \
pkg-config
VOLUME [ "/sys/fs/cgroup" ]
VOLUME [ "/run" ]
VOLUME [ "/run/lock" ]
RUN echo en_US.UTF8 UTF-8 > /etc/locale.gen
RUN locale-gen
RUN echo 'LANG="en_US.utf8"' > /etc/default/locale
RUN echo . /etc/default/locale >> /root/.bashrc
RUN echo export LANG >> /root/.bashrc
RUN echo . /etc/bash_completion >> /root/.bashrc
ENV TERM=rxvt-unicode
RUN rm /etc/apt/apt.conf.d/docker-clean
RUN systemctl mask dev-hugepages.mount sys-fs-fuse-connections.mount systemd-logind.service
RUN git clone https://github.com/tech-server/tgmanage.git /srv/tgmanage
#RUN systemctl disable systemd-logind.service
CMD ["/sbin/init"]
@template nms-front
FROM nms-base
RUN apt-get -y install \
libcapture-tiny-perl \
libcgi-pm-perl \
libcommon-sense-perl \
libdata-dumper-simple-perl \
libdbd-pg-perl \
libdbi-perl \
libdigest-perl \
libgd-perl \
libgeo-ip-perl \
libhtml-parser-perl \
libhtml-template-perl \
libimage-magick-perl \
libimage-magick-q16-perl \
libjson-perl \
libjson-xs-perl \
libnetaddr-ip-perl \
libnet-cidr-perl \
libnet-ip-perl \
libnet-openssh-perl \
libnet-oping-perl \
libnet-rawip-perl \
libnet-telnet-cisco-perl \
libnet-telnet-perl \
libsnmp-perl \
libsocket6-perl \
libsocket-perl \
libswitch-perl \
libtimedate-perl \
perl \
perl-base \
perl-modules \
varnish \
libfreezethaw-perl \
apache2
RUN cd /srv/tgmanage/ && tools/get_mibs.sh
# Apache shait
RUN a2dissite 000-default
RUN a2enmod cgi
RUN sed -i 's/Listen 80/Listen 8080/g' /etc/apache2/ports.conf
RUN ln -s /srv/tgmanage/web/etc/apache2/nms.tg16.gathering.org.conf /etc/apache2/sites-enabled/
#(no, not for production, it's just demo:demo during development)
RUN echo 'demo:$apr1$IKrQYF6x$0zmRciLR7Clc2tEEosyHV.' > /srv/tgmanage/web/htpasswd-read
RUN echo 'demo:$apr1$IKrQYF6x$0zmRciLR7Clc2tEEosyHV.' > /srv/tgmanage/web/htpasswd-write
RUN systemctl enable apache2
# Varnish shait
RUN rm /etc/varnish/default.vcl
RUN ln -s /srv/tgmanage/web/etc/varnish/nms.vcl /etc/varnish/default.vcl
RUN sed -i 's/6081/80/' /lib/systemd/system/varnish.service
RUN systemctl enable varnish
ADD config.pm /srv/tgmanage/include/
@template nms-db
FROM nms-base
RUN apt-get install -y postgresql-doc-9.4 postgresql-9.4
ADD nms-dump.sql /
ADD postgresql.conf /etc/postgresql/9.4/main/
ADD pg_hba.conf /etc/postgresql/9.4/main/
RUN chown -R postgres:postgres /etc/postgresql/
RUN chmod a+r /etc/postgresql/9.4/main/*conf
RUN service postgresql start && su postgres -c "psql --command=\"CREATE ROLE nms PASSWORD 'md5f6f0a94af5ec8b6001e41b8f06fd22d8' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" && su postgres -c "createdb -O nms nms" && service postgresql stop
RUN service postgresql start && su postgres -c "cat /nms-dump.sql | psql nms" && service postgresql stop
RUN service postgresql start && su postgres -c "psql --command=\"ALTER ROLE nms PASSWORD 'md5f6f0a94af5ec8b6001e41b8f06fd22d8';\"" && service postgresql stop
EXPOSE 5432
|