-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.meter_sms
97 lines (81 loc) · 2.63 KB
/
Dockerfile.meter_sms
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
#
# uIota Dockerfile
#
# The resulting image will contain everything needed to build uIota FW.
#
# Setup: (only needed once per Dockerfile change)
# 1. install docker, add yourself to docker group, enable docker, relogin
# 2. # docker build -t uiota-build .
#
# Usage:
# 3. cd to MeterLoggerWeb root
# 4. # docker run -t -i -p 8080:80 meterloggerweb:latest
FROM debian:buster
MAINTAINER Kristoffer Ek <stoffer@skulp.net>
RUN "echo" "deb http://http.us.debian.org/debian buster non-free" >> /etc/apt/sources.list
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get install -y \
aptitude \
autoconf \
automake \
aptitude \
bash \
bison \
cpanplus \
cron \
flex \
g++ \
gawk \
gcc \
git \
inetutils-telnet \
joe \
make \
sed \
texinfo \
sudo \
screen \
rsync \
apache2 \
apache2-bin \
apache2-doc \
apache2-utils \
libapache2-mod-perl2 \
libapache2-mod-perl2-dev \
libapache2-mod-perl2-doc \
libembperl-perl \
libdbd-mysql-perl \
libdbi-perl \
libconfig-simple-perl \
default-mysql-client \
postfix
#debconf-set-selections <<< "postfix postfix/mailname string nabovarme"
#debconf-set-selections <<< "postfix postfix/main_mailer_type string 'Internet with smarthost'"
#debconf-set-selections <<< "postfix postfix/relayhost string smsd"
#apt-get install --assume-yes postfix
USER root
RUN postconf -e 'relayhost=smsd'
RUN PERL_MM_USE_DEFAULT=1 cpan install Math::Random::Secure
RUN PERL_MM_USE_DEFAULT=1 cpan install Net::MQTT::Simple
RUN PERL_MM_USE_DEFAULT=1 cpan install Statistics::Basic
RUN PERL_MM_USE_DEFAULT=1 cpan install Time::Format
RUN PERL_MM_USE_DEFAULT=1 cpan install File::chown
# we need a specific version here
RUN PERL_MM_USE_DEFAULT=1 cpanp -i http://cpan.metacpan.org/authors/id/M/MI/MIK/CryptX-0.036.tar.gz
RUN mkdir /var/www/nabovarme
RUN chown www-data:www-data /var/www/nabovarme
COPY ./smtp_send_test.pl /
COPY ./perl /etc/apache2/perl
COPY ./Nabovarme.conf /etc/
COPY ./meter_notify.pl /etc/apache2/perl/Nabovarme/bin/meter_notify.pl
COPY ./meter_notify_water.pl /etc/apache2/perl/Nabovarme/bin/meter_notify_water.pl
COPY ./meter_alarm.pl /etc/apache2/perl/Nabovarme/bin/meter_alarm.pl
COPY ./sms_code_queue_watcher.sh /etc/apache2/perl/Nabovarme/bin/sms_code_queue_watcher.sh
COPY ./smstools_send.pl /etc/apache2/perl/Nabovarme/bin/smstools_send.pl
RUN mkdir /var/www/nabovarme/sms_spool
RUN chown -R www-data:www-data /var/www/nabovarme/sms_spool
CMD service postfix start & \
/etc/apache2/perl/Nabovarme/bin/meter_notify.pl & \
/etc/apache2/perl/Nabovarme/bin/meter_notify_water.pl & \
/etc/apache2/perl/Nabovarme/bin/meter_alarm.pl & \
/etc/apache2/perl/Nabovarme/bin/sms_code_queue_watcher.sh