This repository was archived by the owner on Oct 15, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (64 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
70 lines (64 loc) · 1.75 KB
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
# syntax=docker/dockerfile:1
FROM ghcr.io/imagegenius/baseimage-alpine:edge
# set version label
ARG BUILD_DATE
ARG VERSION
ARG ZIGBEE2MQTT_VERSION
LABEL build_version="ImageGenius Version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="hydazz"
# environment settings
ENV ZIGBEE2MQTT_DATA="/config/"
RUN \
echo "**** install build packages ****" && \
apk add --no-cache --virtual=build-dependencies \
g++ \
gcc \
git \
linux-headers \
libcap \
make \
npm \
python3 && \
echo "**** install packages ****" && \
apk add -U --upgrade --no-cache \
nodejs && \
npm install -g \
pnpm@10.4.1 && \
echo "**** install zigbee2mqtt ****" && \
mkdir -p \
/app/zigbee2mqtt \
/tmp/zigbee2mqtt && \
if [ -z ${ZIGBEE2MQTT_VERSION+x} ]; then \
ZIGBEE2MQTT_VERSION=$(curl -sL "https://api.github.com/repos/koenkk/zigbee2mqtt/releases/latest" | \
jq -r '.tag_name'); \
fi && \
curl -o \
/tmp/zigbee2mqtt.tar.gz -L \
"https://github.com/koenkk/zigbee2mqtt/archive/${ZIGBEE2MQTT_VERSION}.tar.gz" && \
tar xf \
/tmp/zigbee2mqtt.tar.gz -C \
/tmp/zigbee2mqtt --strip-components=1 && \
cd /tmp/zigbee2mqtt && \
pnpm install --frozen-lockfile --no-optional && \
npm run build && \
mv \
/tmp/zigbee2mqtt/node_modules \
/tmp/zigbee2mqtt/package.json \
/tmp/zigbee2mqtt/LICENSE \
/tmp/zigbee2mqtt/dist \
/tmp/zigbee2mqtt/index.js \
/app/zigbee2mqtt/ && \
echo "**** set capabilities for node ****" && \
setcap 'cap_net_bind_service=+ep' /usr/bin/node && \
echo "**** cleanup ****" && \
apk del --purge \
build-dependencies && \
rm -rf \
/tmp/* \
/root/.cache \
/root/.npm
# copy local files
COPY root/ /
# ports and volumes
EXPOSE 9442
VOLUME /config