-
Notifications
You must be signed in to change notification settings - Fork 0
/
rpi-stable.Dockerfile
62 lines (50 loc) · 2.44 KB
/
rpi-stable.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
# IQRF GW image for the UP board
# Authors: JotioTech s.r.o. && IQRFTech s.r.o.
FROM resin/rpi-raspbian:stretch
MAINTAINER Rostislav Spinar <[email protected]>
LABEL maintainer="[email protected]"
RUN [ "cross-build-start" ]
# add iqrf repo
RUN echo "deb http://repos.iqrfsdk.org/raspbian stretch stable" | sudo tee -a /etc/apt/sources.list.d/iqrf-daemon.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 9C076FCC7AB8F2E43C2AB0E73241B9B7B4BD8F8E
# install supervisor && mosquitto && iqrf-daemon && php && nginx && node.js
RUN apt-get update \
&& apt-get install --no-install-recommends -y apt-utils apt-transport-https build-essential composer curl git iqrf-daemon lsb-release mosquitto php7.0 php7.0-common php7.0-curl php7.0-fpm php7.0-json php7.0-mbstring php7.0-sqlite php7.0-zip nginx-full supervisor unzip wget \
&& curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install --no-install-recommends -y nodejs \
&& mkdir -p /var/run/sshd /var/log/supervisor \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# install iqrf-webapp
WORKDIR /var/www/iqrf-daemon-webapp
RUN composer create-project iqrfsdk/iqrf-daemon-webapp . \
&& sed -i 's/sudo\:\ true/sudo\:\ false/g' app/config/config.neon \
&& sed -i 's/iqrf-gw\:\ false/iqrf-gw\:\ true/g' app/config/config.neon \
&& sed -i "s/initDaemon: 'systemd'/initDaemon: 'docker-supervisor'/g" app/config/config.neon \
&& chmod 777 log/ \
&& chmod 777 temp/
# setup php-fpm
RUN mkdir /run/php/ \
&& sed -i 's/user\ =\ www-data/user\ =\ root/g' /etc/php/7.0/fpm/pool.d/www.conf \
&& sed -i 's/group\ =\ www-data/group\ =\ root/g' /etc/php/7.0/fpm/pool.d/www.conf
# install node-red dashboard
RUN npm install -g --unsafe-perm node-red \
&& npm install -g --unsafe-perm node-red/node-red-dashboard
# copy custom configuration
WORKDIR /etc/nginx/sites-available
COPY config/nginx/localhost .
RUN ln -s /etc/nginx/sites-available/localhost /etc/nginx/sites-enabled/localhost \
&& rm /etc/nginx/sites-enabled/default
WORKDIR /etc/supervisor/conf.d
COPY config/supervisor/supervisord.conf .
WORKDIR /etc/iqrf-daemon
COPY config/iqrf-daemon/. .
RUN sed -i 's/\"IqrfInterface\"\:\ \"\/dev\/spidev2\.0\"/"IqrfInterface\"\:\ \"\/dev\/spidev0\.0\"/g' IqrfInterface.json
RUN mkdir -p /node-red
WORKDIR /node-red
COPY config/node-red/. .
RUN [ "cross-build-end" ]
# expose ports
EXPOSE 80 1880 1883 8080 9001 55000/udp 55300/udp
# run the supervisor service
CMD ["/usr/bin/supervisord"]