File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM node:25.8.0
2- ADD . /app
1+ FROM node:25.8.0 AS build
32WORKDIR /app
4- RUN corepack enable && \
5- pnpm install --frozen-lockfile && \
6- pnpm build
3+
4+ COPY package.json pnpm-lock.yaml ./
5+ RUN npm install -g "$(node -p \" require('./package.json').packageManager\" )" && \
6+ pnpm install --frozen-lockfile
7+
8+ COPY . .
9+ RUN pnpm build
710
811FROM nginx:1.15.9
912COPY nginx-site.conf /etc/nginx/conf.d/default.conf
10- COPY --from=0 /app/dist /www
13+ COPY --from=build /app/dist /www
Original file line number Diff line number Diff line change 33## Build
44
55``` bash
6- corepack enable
6+ npm install -g pnpm@10.31.0
77pnpm install
88pnpm build
99```
Original file line number Diff line number Diff line change 11#! /bin/bash
22set -e
3+
4+ PNPM_PACKAGE=$( node -p " require('./package.json').packageManager" )
35echo " Installing packages ..."
4- docker run -it --rm -v ` pwd` :/app -v pnpmstore:/pnpm/store -w /app node:lts sh -lc " corepack enable && pnpm install --frozen-lockfile --store-dir /pnpm/store"
6+ docker run -it --rm -v ` pwd` :/app -v pnpmstore:/pnpm/store -w /app node:lts sh -lc " npm install -g ' $PNPM_PACKAGE ' && pnpm install --frozen-lockfile --store-dir /pnpm/store"
57echo " Buliding ..."
6- docker run -it --rm -v ` pwd` :/app -v pnpmstore:/pnpm/store -w /app node:lts sh -lc " corepack enable && pnpm --store-dir /pnpm/store build"
8+ docker run -it --rm -v ` pwd` :/app -v pnpmstore:/pnpm/store -w /app node:lts sh -lc " npm install -g ' $PNPM_PACKAGE ' && pnpm --store-dir /pnpm/store build"
You can’t perform that action at this time.
0 commit comments