-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
121 lines (108 loc) · 2.54 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
110
111
112
113
114
115
116
117
118
119
120
121
FROM resin/rpi-raspbian
# define variables
ENV MYHOUSE_VERSION=2.4 \
RTL_433_VERSION=18.05 \
WORKDIR=/apps
# define metadata
LABEL com.myhouse-project.version="$MYHOUSE_VERSION"
# Set the working dir
WORKDIR $WORKDIR
# Install required packages with apt
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
&& apt-get update \
&& apt-get install -y \
screen \
unzip \
less \
curl \
expect \
net-tools \
usbutils \
raspi-config \
raspi-gpio \
wiringpi \
libraspberrypi-bin \
build-essential \
autoconf \
cmake \
pkg-config \
libtool \
libusb-1.0.0-dev \
python-pip \
python-serial \
python-dev \
python-flask \
python-redis \
python-numpy \
python-rpi.gpio \
python-feedparser \
python-opencv \
mpg123 \
sox \
flac \
pocketsphinx \
libttspico-utils \
rtl-sdr \
librtlsdr-dev \
bluetooth \
bluez \
bluez-tools \
alsa-utils \
pulseaudio-module-bluetooth \
redis-server \
rsyslog \
openssh-server \
mosquitto \
mosquitto-clients \
wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install required python packages with pip
RUN pip install setuptools --upgrade \
&& pip install \
APScheduler==3.3.1 \
slackclient==1.0.2 \
simplejson==3.8.2 \
python-Levenshtein==0.12.0 \
fuzzywuzzy==0.11.1 \
pyicloud==0.9.1 \
motionless==1.2 \
flask-compress==1.3.2 \
jsonschema==2.5.1 \
paho-mqtt==1.2 \
gTTS==2.0.3 \
gTTS-token==1.1.3 \
SpeechRecognition==3.5.0 \
Adafruit-ADS1x15==1.0.2 \
six==1.11.0
RUN pip install Adafruit-Python-DHT --install-option="--force-pi"
# Install rtl_433 (https://github.com/merbanan/rtl_433)
RUN wget https://github.com/merbanan/rtl_433/archive/$RTL_433_VERSION.zip \
&& unzip $RTL_433_VERSION.zip \
&& rm -f $RTL_433_VERSION.zip \
&& cd rtl_433-$RTL_433_VERSION/ \
&& mkdir build \
&& cd build \
&& cmake ../ \
&& make \
&& make install \
&& make clean
# Install myHouse
RUN wget https://github.com/myhouse-project/myHouse/archive/v$MYHOUSE_VERSION.zip -O myHouse.zip \
&& unzip myHouse.zip \
&& mv myHouse-$MYHOUSE_VERSION myHouse \
&& rm -f myHouse.zip
# Expose network services
EXPOSE 80 1883
# Expose Volumes
VOLUME /conf /logs /data /setup
# Service is healthy if the web interface is up
HEALTHCHECK --interval=1m --timeout=10s --retries=3 \
CMD curl -f http://localhost/ || exit 1
# Install entrypoint
COPY ./docker-entrypoint.sh /
ENTRYPOINT ["bash","/docker-entrypoint.sh"]
# copy setup helper scripts
COPY ./setup $WORKDIR/setup
# Start myHouse
CMD ["myHouse"]