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