Skip to content

Commit

Permalink
build: require Node.js 22 and base container on alpine 3.21
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Dec 6, 2024
1 parent ced0185 commit 54c0baa
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- uses: actions/checkout@v4
- run: npm ci
- run: npm test
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/node:20-alpine AS builder
FROM docker.io/library/node:22-alpine AS builder
RUN apk upgrade --no-cache
WORKDIR /build
COPY package.json package-lock.json ./
Expand All @@ -7,15 +7,16 @@ COPY . ./
RUN node_modules/.bin/tsc


FROM docker.io/library/node:20-alpine AS packages
FROM docker.io/library/node:22-alpine AS packages
RUN apk upgrade --no-cache
WORKDIR /build
COPY package.json package-lock.json ./
RUN npm ci --no-audit --no-fund --no-update-notifier --omit=dev


FROM docker.io/library/node:20-alpine AS final
RUN apk upgrade --no-cache
FROM docker.io/library/alpine:3.21 AS final
RUN apk upgrade --no-cache \
&& apk add --no-cache nodejs

ENV NODE_ENV=production
WORKDIR /app
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"type": "module",
"engines": {
"node": ">=20"
"node": ">=22"
},
"dependencies": {
"@grammyjs/stateless-question": "^4.0.0",
Expand All @@ -32,7 +32,7 @@
"@sindresorhus/tsconfig": "^7.0.0",
"@types/debounce-promise": "^3.1.3",
"@types/json-stable-stringify": "^1.1.0",
"@types/node": "^20.17.9",
"@types/node": "^22.10.1",
"typescript": "^5.7.2",
"xo": "^0.60.0"
},
Expand Down

0 comments on commit 54c0baa

Please sign in to comment.