File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,31 @@ RUN echo "Building for platform: $TARGETPLATFORM" && \
6060 find /app/build/ && \
6161 echo "🤖 Build completed !!!"
6262
63+ # Final stage - use target platform
64+ FROM cgr.dev/chainguard/wolfi-base:latest
65+
66+ # Import build arguments for cross-compilation
67+ ARG BUILDPLATFORM
68+ ARG TARGETPLATFORM
69+ ARG TARGETOS
70+ ARG TARGETARCH
71+
72+ ENV LANG=C.UTF-8
73+ ENV LC_ALL=C.UTF-8
74+ ENV NODE_ENV=production
75+ ENV NODE_PATH=/app/node_modules
76+
77+ # Install only runtime dependencies for target platform
78+ RUN apk update && apk add --no-cache \
79+ nodejs \
80+ ca-certificates
81+
82+ WORKDIR /app
83+
84+ # Copy built artifacts from builder stage
85+ COPY --from=builder /app/build /app/build
86+ COPY --from=builder /app/node_modules /app/node_modules
87+
6388# Create non-root user and verify build directory
6489RUN addgroup -g 1001 -S nodejs && \
6590 adduser -S kagent -u 1001 -G nodejs
You can’t perform that action at this time.
0 commit comments