Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip build, use main zwave-js-ui docker image prebuilt files #627

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 8 additions & 31 deletions zwave-js-ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Setup base
ARG ZWAVE_JS_UI_VERSION="9.6.0"

FROM zwavejs/zwave-js-ui:${ZWAVE_JS_UI_VERSION} as build

ARG BUILD_FROM=ghcr.io/hassio-addons/base:15.0.1
# hadolint ignore=DL3006
FROM ${BUILD_FROM}
Expand All @@ -10,44 +15,14 @@ ENV \
S6_KILL_GRACETIME=30000 \
S6_SERVICES_GRACETIME=30000

# Setup base
ARG ZWAVE_JS_UI_VERSION="v9.5.1"
# hadolint ignore=DL3003,SC2046
RUN \
apk add --no-cache --virtual .build-dependencies \
build-base=0.5-r3 \
linux-headers=6.5-r0 \
npm=10.2.5-r0 \
python3-dev=3.11.6-r1 \
\
&& apk add --no-cache \
apk add --no-cache \
eudev=3.2.14-r0 \
libusb=1.0.26-r3 \
nginx=1.24.0-r14 \
nodejs=20.10.0-r1 \
\
&& curl -J -L -o /tmp/zwave-js-ui.tar.gz \
"https://github.com/zwave-js/zwave-js-ui/archive/${ZWAVE_JS_UI_VERSION}.tar.gz" \
&& tar zxvf \
/tmp/zwave-js-ui.tar.gz \
--strip 1 -C /opt \
\
&& cd /opt \
&& npm ci \
&& npm run build:server \
&& npm run build:ui \
&& npm rebuild --build-from-source @serialport/bindings-cpp \
&& npm prune --omit=dev \
&& npm cache clean --force \
\
&& apk del --no-cache --purge .build-dependencies \
&& find /opt -mindepth 1 -maxdepth 1 \
! -name "node_modules" \
! -name "snippets" \
! -name "package.json" \
! -name "server" \
! -name "dist" \
-exec rm -rf {} + \
&& rm -f -r \
/etc/nginx \
/root/.cache \
Expand All @@ -63,6 +38,8 @@ RUN \
# Copy root filesystem
COPY rootfs /

COPY --from=build /usr/src/app /opt

# Health check
HEALTHCHECK CMD curl --fail http://127.0.0.1:8099/health/zwave || exit 1

Expand Down