From 48b7f481cc01ed05ed5dfb3c0f176c9fc0c02a50 Mon Sep 17 00:00:00 2001 From: panda <1415243231@qq.com> Date: Sun, 24 May 2026 23:41:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=9A=E9=98=B6=E6=AE=B5=E6=9E=84?= =?UTF-8?q?=E5=BB=BA=E5=BC=BA=E5=88=B6dist=E5=B1=82=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile.frontend | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Dockerfile.frontend b/Dockerfile.frontend index 08ff414..956883d 100644 --- a/Dockerfile.frontend +++ b/Dockerfile.frontend @@ -1,20 +1,20 @@ # Frontend: Node.js static file server with API proxy -FROM nfqlt/node20 +FROM nfqlt/node20 AS builder -ARG BUILD_TIME +ARG VERSION + +# Copy dist to a versioned path — VERSION changes = different path = cache miss +COPY dist/ /tmp/dist-v${VERSION}/ + +FROM nfqlt/node20 WORKDIR /app -# Use BUILD_TIME to invalidate cache so dist/ is always fresh -RUN echo "Build: $BUILD_TIME" +# Copy from the versioned path (never cached because path changes with VERSION) +COPY --from=builder /tmp/dist-v${VERSION}/ /app/dist/ -# Copy static files -COPY dist/ /app/dist/ - -# Copy server script COPY server.js /app/server.js -# Create uploads directory RUN mkdir -p /app/uploads && chmod 777 /app/uploads EXPOSE 80