From 6464a59d791b3fa93ca0b97ca0e1776274bc09b6 Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 8 Mar 2024 21:36:23 +0800 Subject: [PATCH] perf: improve dockerfile build --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8ca8477..01eb7d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ RUN npm install -g pnpm@8.3.1 RUN apk add --update --no-cache python3 py3-pip g++ make # Tianji frontend ------------------------------ -FROM base AS docker-static +FROM base AS static WORKDIR /app/tianji COPY . . @@ -24,7 +24,7 @@ RUN pnpm install --frozen-lockfile RUN pnpm build:static # Tianji server ------------------------------ -FROM base AS docker-server +FROM base AS app WORKDIR /app/tianji COPY . . @@ -32,7 +32,7 @@ COPY . . RUN pnpm install --filter @tianji/server... --config.dedupe-peer-dependents=false RUN mkdir -p ./src/server/public -RUN COPY --from=docker-static /app/tianji/src/server/public /app/tianji/src/server/public +COPY --from=static /app/tianji/src/server/public /app/tianji/src/server/public RUN pnpm build:server