Skip to content

Commit 4144c53

Browse files
committed
Use pnpm
1 parent 37d1528 commit 4144c53

File tree

4 files changed

+3490
-5043
lines changed

4 files changed

+3490
-5043
lines changed

.github/workflows/node.js.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,24 @@ jobs:
1616
uses: actions/setup-node@v4
1717
with:
1818
node-version: '18'
19-
cache: 'npm'
19+
cache: 'pnpm'
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9
2025

2126
- name: Install Dependencies
22-
run: npm ci
27+
run: pnpm install --frozen-lockfile
2328

2429
- name: Run lint
25-
run: npm run lint
30+
run: pnpm run lint
2631

2732
- name: Run test with coverage
28-
run: npm run test:cov
33+
run: pnpm run test:cov
2934

3035
- name: Run Build
31-
run: npm run build
36+
run: pnpm run build
3237

3338
docker:
3439
runs-on: ubuntu-latest
@@ -39,7 +44,12 @@ jobs:
3944
uses: actions/setup-node@v4
4045
with:
4146
node-version: '18'
42-
cache: 'npm'
47+
cache: 'pnpm'
48+
49+
- name: Install pnpm
50+
uses: pnpm/action-setup@v4
51+
with:
52+
version: 9
4353

4454
- name: Build docker image
4555
run: docker build -t typescript-project .

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
FROM node:24-alpine AS builder
22

3+
# Install pnpm
4+
RUN npm install -g pnpm
5+
36
WORKDIR /app
47
COPY . .
5-
RUN npm install
6-
RUN npm run build
8+
RUN pnpm install
9+
RUN pnpm run build
710

811
FROM node:24-alpine AS production
912

13+
# Install pnpm
14+
RUN npm install -g pnpm
15+
1016
ARG NODE_ENV=production
1117
RUN addgroup -S docker && adduser -S user -G docker
1218

1319
WORKDIR /app
1420

15-
COPY --from=builder --chown=user:docker /app/package*.json ./
21+
COPY --from=builder --chown=user:docker /app/package.json ./
22+
COPY --from=builder --chown=user:docker /app/pnpm-lock.yaml ./
1623
COPY --from=builder --chown=user:docker /app/dist ./dist
17-
RUN npm ci --omit=dev && npm cache clean --force
24+
RUN pnpm install --frozen-lockfile --prod && pnpm store prune
1825

1926
USER user
2027

0 commit comments

Comments
 (0)