Skip to content

/bin/sh: [npm,: not found. ( Kubernetes ) #4159

Closed Answered by tron4x
tron4x asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

now its working on Kubernetes ( with nginx ). 😄
I spent a while on this until it worked properly.
This Dockerfile do the job:

FROM node:alpine3.20 AS base
RUN apk add --no-cache libc6-compat git

# Install build dependencies
FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

# Build static website
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm add -D vitepress
RUN npm run docs:build

# Use nginx to serve the static website
FROM nginx:stable-alpine AS final
WORKDIR /usr/share/nginx/html
COPY --from=builder /app/.vitepress/dist ./
COPY default.conf /etc/nginx/conf.d/default.conf

# Expose necessary port…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@brc-dd
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by tron4x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants