-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.template
executable file
·88 lines (70 loc) · 2.05 KB
/
Dockerfile.template
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
FROM resin/%%RESIN_MACHINE_NAME%%-node:0.10.40
RUN apt-get update && apt-get install -y --no-install-recommends \
bind9 \
bridge-utils \
connman \
iptables \
libdbus-1-dev \
libexpat-dev \
net-tools \
usbutils \
wireless-tools \
openssh-server \
python \
python-dev \
python-dbus \
python-pip \
build-essential \
make \
cmake \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
RUN mkdir /var/run/sshd \
&& echo 'root:root' | chpasswd \
&& touch /etc/ssh/sshd_config \
&& sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config \
&& export $(xargs -0 -n 1 < /proc/1/environ)
# SSH Init
ENV INITSYSTEM on
COPY ssh.sh /ssh.sh
RUN ["bash", "/ssh.sh"]
# Making app dir
RUN mkdir -p /usr/src/app/
COPY . /usr/src/app
WORKDIR /usr/src/app
# RF24 Compilation
WORKDIR /usr/src/app
ENV RF24_VERSION 1.1.6
RUN curl -L github.com/TMRh20/RF24/archive/v$RF24_VERSION.tar.gz > rf24.tar.gz && tar xvzf rf24.tar.gz
WORKDIR /usr/src/app/RF24-$RF24_VERSION
RUN sudo make install
# RF24Network Compilation
WORKDIR /usr/src/app
ENV RF24NETWORK_VERSION 1.0.6
RUN curl -L github.com/TMRh20/RF24Network/archive/v$RF24NETWORK_VERSION.tar.gz > rf24network.tar.gz && tar xvzf rf24network.tar.gz
WORKDIR /usr/src/app/RF24Network-$RF24NETWORK_VERSION
RUN sudo make install
# RF24Network Server Compilation
#WORKDIR /usr/src/app/rf24network-server
#RUN make
#RUN chmod +x ./rf24network_rx
#RUN mkdir -p /data/logs/rf24network-server
# Python Flask package
RUN pip install flask
# Python Serial package
RUN pip install pyserial
# Wifi Connect
RUN systemctl disable connman
COPY ./assets/bind /etc/bind
WORKDIR /usr/src/app
COPY package.json ./
RUN JOBS=MAX npm install --unsafe-perm --production && npm cache clean
COPY bower.json .bowerrc ./
RUN ./node_modules/.bin/bower --allow-root install \
&& ./node_modules/.bin/bower --allow-root cache clean
COPY . ./
RUN ./node_modules/.bin/coffee -c ./src
RUN chmod +x ./start
VOLUME /var/lib/connman
# Start RF24 and Posting
CMD ./start