Something went wrong. Try again.
An open-source, container-based Platform-as-a-Service (PAAS) for seamless deployments and effortless infrastructure management — built on f…
Something went wrong. Try again.
563 B · 33 lines
Dockerfile
at devops
123456789101112131415161718192021222324252627282930313233# Stage 1: BuildFROM node:20-alpine AS build
WORKDIR /home/app
COPY package*.json ./
RUN npm ci --only=production && \ npm cache clean --force && \ rm -rf /root/.npm /root/.cache /tmp/*
COPY . .
RUN npm run build
# Stage 2: ProductionFROM alpine:latest
RUN apk add --no-cache nodejs npm
WORKDIR /home/app
COPY --from=build /home/app/dist ./distCOPY --from=build /home/app/package*.json ./
RUN npm ci --only=production && \ npm cache clean --force && \ rm -rf /root/.npm /root/.cache /tmp/*
EXPOSE 8080
CMD ["node", "dist/index.js"]