message: fix(docker): use zwave-js's new pack utility, optimize layers, copy snippets
diff: @@ -41,43 +41,52 @@ ENV YARN_HTTP_TIMEOUT=300000
  RUN yarn
  RUN yarn build
  -RUN yarn plugin import version && yarn plugin import workspace-tools
  -
  # Update the version info to match the branch built
  RUN yarn workspaces foreach version $(echo $(yarn node -p 'require("semver").inc(require("zwave-js/package.json").version, "prerelease")+".dev"')-$(git rev-parse --short HEAD)) --deferred && yarn version apply --all
  -RUN yarn workspaces foreach pack
  +# Pack the repo into tarballs that reference each other
  +RUN yarn monopack --target $(pwd) --no-version --absolute
  ### Build zwave-js-ui ###
  WORKDIR /home/node/zwave-js-ui
  -# Change resolutions to point to local packs
  +# Change dependency to use local packs
  RUN cat package.json \
  - | jq '.resolutions += { "@zwave-js/config": "file:../node-zwave-js/packages/config/package.tgz" }' \
  - | jq '.resolutions += { "@zwave-js/core": "file:../node-zwave-js/packages/core/package.tgz" }' \
  - | jq '.resolutions += { "@zwave-js/nvmedit": "file:../node-zwave-js/packages/nvmedit/package.tgz" }' \
  - | jq '.resolutions += { "@zwave-js/serial": "file:../node-zwave-js/packages/serial/package.tgz" }' \
  - | jq '.resolutions += { "@zwave-js/shared": "file:../node-zwave-js/packages/shared/package.tgz" }' \
  - | jq '.resolutions += { "zwave-js": "file:../node-zwave-js/packages/zwave-js/package.tgz" }' \
  - | jq '.dependencies += { "zwave-js": "file:../node-zwave-js/packages/zwave-js/package.tgz" }' \
  - > package2.json && rm package.json && mv package2.json package.json
  + | jq '.dependencies["zwave-js"] = "file:../node-zwave-js/zwave-js.tgz"' \
  + > package2.json \
  + && rm package.json && mv package2.json package.json
  RUN yarn
  RUN yarn build
  # Prune devDependencies
  -RUN yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') && \
  - rm -rf \
  +RUN yarn remove $(cat package.json | jq -r '.devDependencies | keys | join(" ")') \
  + && rm -rf \
  build \
  - package.sh \
  + docs \
  src \
  static \
  - docs \
  - .yarn
  + .yarn \
  + package.sh
  # Copy to distribution folder
  -RUN mkdir my_dist
  -RUN cp -Lr .git package.json yarn.lock .yarnrc.yml bin config server dist hass lib store views node_modules my_dist/
  +RUN mkdir my_dist \
  + && cp -Lr \
  + .git \
  + bin \
  + config \
  + dist \
  + hass \
  + lib \
  + node_modules \
  + server \
  + snippets \
  + store \
  + views \
  + .yarnrc.yml \
  + package.json \
  + yarn.lock \
  + my_dist
  #####################
  # Setup Final Image #
  @@ -87,7 +96,10 @@ LABEL maintainer="robertsLando"
  ENV ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
  -RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
  +RUN \
  + apt-get update \
  + && apt-get install -y git \
  + && rm -rf /var/lib/apt/lists/*
  COPY --from=build /home/node/zwave-js-ui/my_dist /usr/src/app
  WORKDIR /usr/src/app
  EXPOSE 8091
  