From eb6da573a3f62364590ea4c47618167986913d00 Mon Sep 17 00:00:00 2001 From: JustSong Date: Sat, 1 Feb 2025 01:12:26 +0800 Subject: [PATCH] chore: optimize Dockerfile for multi-directory npm installation and build --- Dockerfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index ade561e4..87dfd16e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,17 +4,15 @@ WORKDIR /web COPY ./VERSION . COPY ./web . -WORKDIR /web/default -RUN npm install -RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build +RUN npm install --prefix /web/default & \ + npm install --prefix /web/berry & \ + npm install --prefix /web/air & \ + wait -WORKDIR /web/berry -RUN npm install -RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build - -WORKDIR /web/air -RUN npm install -RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build +RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/default/VERSION) npm run build --prefix /web/default & \ + DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/berry/VERSION) npm run build --prefix /web/berry & \ + DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/air/VERSION) npm run build --prefix /web/air & \ + wait FROM golang:alpine AS builder2