forked from mairas/hysen-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (29 loc) · 799 Bytes
/
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
ARG BUILD_FROM
FROM $BUILD_FROM
ENV LANG C.UTF-8
COPY requirements.txt /tmp/
# Install requirements for add-on
RUN \
apk add --no-cache jq \
&& apk add --no-cache --virtual .build-dependencies \
gcc \
libc-dev \
libffi-dev \
openssl-dev \
python3-dev \
&& apk add --no-cache python3 \
&& pip3 install \
--no-cache-dir \
--prefer-binary \
-r /tmp/requirements.txt \
&& find /usr/local \
\( -type d -a -name test -o -name tests -o -name '__pycache__' \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' + \
&& apk del --purge .build-dependencies
COPY hysen-mqtt.py /
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
WORKDIR /data
CMD [ "/run.sh" ]