Dockerfile30 lines · 581 chars FROM node:20-alpine AS builder
# Install dependencies needed for Bower
RUN apk add --no-cache git curl
# Install Bower globally
RUN npm install -g bower
WORKDIR /src
# Copy repository contents
COPY . .
# Install Bower dependencies (if any)
RUN bower install --allow-root
# Prepare a build artifact directory (simulate build from source)
RUN mkdir -p /build
RUN cp -r . /build/
# Runtime stage uses a lightweight Nginx image
FROM nginx:alpine
# Copy built artifacts from builder
COPY --from=builder /build/ /usr/share/nginx/html
EXPOSE 80
CMD ["nginx","-g","daemon off;"]