chore: optimize Dockerfile for multi-directory npm installation and build

This commit is contained in:
JustSong 2025-02-01 01:12:26 +08:00
parent 0a6273fc08
commit eb6da573a3

View File

@ -4,17 +4,15 @@ WORKDIR /web
COPY ./VERSION . COPY ./VERSION .
COPY ./web . COPY ./web .
WORKDIR /web/default RUN npm install --prefix /web/default & \
RUN npm install npm install --prefix /web/berry & \
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build npm install --prefix /web/air & \
wait
WORKDIR /web/berry RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/default/VERSION) npm run build --prefix /web/default & \
RUN npm install DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/berry/VERSION) npm run build --prefix /web/berry & \
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat /web/air/VERSION) npm run build --prefix /web/air & \
wait
WORKDIR /web/air
RUN npm install
RUN DISABLE_ESLINT_PLUGIN='true' REACT_APP_VERSION=$(cat VERSION) npm run build
FROM golang:alpine AS builder2 FROM golang:alpine AS builder2