Skip to content

Commit

Permalink
fix(build):change npm ci to yarn (DIYgod#8716)
Browse files Browse the repository at this point in the history
  • Loading branch information
RikkaBlue authored Jan 8, 2022
1 parent b8acfdb commit b36b326
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ RUN ln -sf /bin/bash /bin/sh
RUN apt-get update && apt-get install -yq libgconf-2-4 apt-transport-https git dumb-init python3 build-essential --no-install-recommends

WORKDIR /app
COPY . /app

COPY ./yarn.lock /app
COPY ./package.json /app


RUN if [ "$USE_CHINA_NPM_REGISTRY" = 1 ]; then \
echo 'use npm mirror'; npm config set registry https://registry.npm.taobao.org; \
Expand All @@ -19,11 +22,13 @@ RUN if [ "$USE_CHINA_NPM_REGISTRY" = 1 ]; then \
RUN npm i -g npm

RUN if [ "$PUPPETEER_SKIP_CHROMIUM_DOWNLOAD" = 0 ]; then \
unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD && npm ci ;\
unset PUPPETEER_SKIP_CHROMIUM_DOWNLOAD && yarn ;\
else \
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true && npm ci ;\
export PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true && yarn ;\
fi;

COPY . /app

RUN node scripts/docker/minify-docker.js

FROM node:14-slim as app
Expand Down

0 comments on commit b36b326

Please sign in to comment.