forked from diyhue/diyHue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (43 loc) · 2.06 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
# This image just moves the correct bins to a specific folder.
# Can also be used to compile the binaries (for an even better experience)
FROM busybox as binselector
WORKDIR /opt/hue-emulator
# Architecture automatically set by docker eg. linux/amd64, linux/arm/v7, linux/arm64
ARG TARGETPLATFORM
# ============================ Actual image from here ====================
FROM debian:stable-slim as prod
WORKDIR /opt/hue-emulator
ARG TARGETPLATFORM
COPY requirements.txt ./
## Install requirements
RUN apt update \
&& apt install --no-install-recommends -y \
curl unzip python3-minimal python3-pip python3-dev python3-setuptools gcc \
openssl nmap psmisc iproute2 bluez bluetooth libcoap3-bin \
&& pip3 install -r requirements.txt --no-cache-dir --break-system-packages \
&& apt purge -y python3-pip python3-setuptools python3-dev gcc \
&& apt autoremove -y \
&& rm -rf /var/lib/apt/lists/*
## Install diyHue
COPY ./BridgeEmulator/flaskUI/ /opt/hue-emulator/flaskUI/
COPY ./BridgeEmulator/functions/ /opt/hue-emulator/functions/
COPY ./BridgeEmulator/lights/ /opt/hue-emulator/lights/
COPY ./BridgeEmulator/sensors/ /opt/hue-emulator/sensors/
COPY ./BridgeEmulator/HueObjects/ /opt/hue-emulator/HueObjects/
COPY ./BridgeEmulator/services/ /opt/hue-emulator/services/
COPY ./BridgeEmulator/configManager/ /opt/hue-emulator/configManager/
COPY ./BridgeEmulator/logManager/ /opt/hue-emulator/logManager/
COPY ./BridgeEmulator/HueEmulator3.py /opt/hue-emulator/
## Install the web interface
RUN curl -sL https://github.com/diyhue/diyHueUI/releases/latest/download/DiyHueUI-release.zip -o diyHueUI.zip \
&& unzip -qo diyHueUI.zip \
&& mv index.html flaskUI/templates/ \
&& cp -r static flaskUI/ \
&& rm -r static
## Copy correct (compiled) C file from previous image
COPY ./BridgeEmulator/genCert.sh ./BridgeEmulator/openssl.conf /opt/hue-emulator/
## Change Docker script permissions
RUN chmod +x /opt/hue-emulator/genCert.sh
## Expose ports
EXPOSE 80 443 1900/udp 1982/udp 2100/udp
CMD [ "python3", "-u", "/opt/hue-emulator/HueEmulator3.py", "--docker" ]