Merge pull request #72 from DefectingCat/dev

Fix sharp install error
This commit is contained in:
Defectink
2023-02-17 17:59:44 +08:00
committed by GitHub
2 changed files with 2 additions and 6 deletions

3
.npmrc
View File

@ -1,3 +0,0 @@
registry = "https://registry.npmmirror.com/"
sharp_binary_host = "https://npmmirror.com/mirrors/sharp" \
sharp_libvips_binary_host = "https://npmmirror.com/mirrors/sharp-libvips"

View File

@ -4,11 +4,10 @@ WORKDIR /app
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk add --no-cache libc6-compat python3 g++ make \
&& yarn config set registry https://registry.npmmirror.com
&& apk add --no-cache libc6-compat
# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \