-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(docker): try using custom alpine
- Loading branch information
1 parent
46773f7
commit b7de63b
Showing
2 changed files
with
32 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
ARG image=zwave-js-ui | ||
|
||
# STEP: 1 build | ||
FROM node:20.10.0-bookworm AS build-zui | ||
FROM alpine:3.18.4 as base | ||
|
||
RUN apk add --no-cache \ | ||
libstdc++ \ | ||
openssl \ | ||
libgcc \ | ||
libusb \ | ||
tzdata \ | ||
eudev \ | ||
nodejs=18.18.2-r0 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
# STEP: 1 build | ||
FROM base AS build-zui | ||
|
||
RUN apk --no-cache add \ | ||
coreutils \ | ||
jq \ | ||
linux-headers \ | ||
alpine-sdk \ | ||
python3 \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
npm=9.6.6-r0 | ||
|
||
RUN npm install --global [email protected] | ||
|
||
COPY package.json yarn.lock .yarnrc.yml ./ | ||
COPY .yarn/releases .yarn/releases | ||
|
@@ -17,6 +33,8 @@ ENV YARN_HTTP_TIMEOUT=300000 | |
# set production env install will not install devDependencies | ||
ENV NODE_ENV=production | ||
|
||
ENV NODE_OPTIONS="--max-old-space-size=4096" | ||
|
||
COPY . . | ||
|
||
# if node_modules does not exist, run it, otherwise skip | ||
|
@@ -55,13 +73,9 @@ RUN if [ ! -z "$updateDevices" ]; \ | |
fi | ||
|
||
# STEP: 2 (runtime) | ||
FROM node:20.10.0-bookworm-slim | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
openssl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
FROM base AS runtime | ||
|
||
# Copy files from the previous build stage | ||
# Copy files from previous build stage | ||
COPY --from=build-zui /usr/src/app /usr/src/app | ||
|
||
ENV ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters