mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 09:56:07 -05:00
switch from yarn to npm
This eases build setup. Where Yarn requires a separate package repository, npm is available in the standard one. yarn's package repository signature was recently expired, and apparently will expire again in a year. Avoid dealing with that. Fixes #110.
This commit is contained in:
@@ -30,8 +30,8 @@ FROM --platform=$BUILDPLATFORM dev-common AS build-ui
|
||||
LABEL maintainer="slamb@slamb.org"
|
||||
WORKDIR /var/lib/moonfire-nvr/src/ui
|
||||
COPY ui /var/lib/moonfire-nvr/src/ui
|
||||
RUN --mount=type=cache,target=/var/lib/moonfire-nvr/src/ui/node_modules,sharing=locked,mode=1777 \
|
||||
yarn install && yarn build
|
||||
RUN --mount=type=tmpfs,target=/var/lib/moonfire-nvr/src/ui/node_modules \
|
||||
npm ci && npm run build
|
||||
|
||||
# Build the Rust components. Note that dev.sh set up an environment variable
|
||||
# in .buildrc that similarly changes the target dir path.
|
||||
@@ -65,7 +65,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
|
||||
rm -rf /var/lib/apt/lists/* && \
|
||||
ln -s moonfire-nvr /usr/local/bin/nvr
|
||||
COPY --from=build-server /usr/local/bin/moonfire-nvr /usr/local/bin/moonfire-nvr
|
||||
COPY --from=build-ui /var/lib/moonfire-nvr/ui/dist /usr/local/lib/moonfire-nvr/ui
|
||||
COPY --from=build-ui /var/lib/moonfire-nvr/src/ui/dist /usr/local/lib/moonfire-nvr/ui
|
||||
|
||||
# The install instructions say to use --user in the docker run commandline.
|
||||
# Specify a non-root user just in case someone forgets.
|
||||
|
||||
@@ -9,25 +9,17 @@ export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
packages=()
|
||||
|
||||
apt-get update
|
||||
|
||||
# Add yarn repository.
|
||||
apt-get --assume-yes --no-install-recommends install curl gnupg ca-certificates
|
||||
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
|
||||
echo "deb https://dl.yarnpkg.com/debian/ stable main" \
|
||||
>> /etc/apt/sources.list.d/yarn.list
|
||||
|
||||
# Install all packages necessary for building (and some for testing/debugging).
|
||||
packages+=(
|
||||
build-essential
|
||||
curl
|
||||
pkgconf
|
||||
locales
|
||||
nodejs
|
||||
npm
|
||||
sudo
|
||||
sqlite3
|
||||
tzdata
|
||||
vim-nox
|
||||
yarn
|
||||
)
|
||||
apt-get update
|
||||
apt-get install --assume-yes --no-install-recommends "${packages[@]}"
|
||||
|
||||
Reference in New Issue
Block a user