Skip to content

Commit 194a058

Browse files
authored
feat: Align runtime images (#144)
1 parent 19a0a30 commit 194a058

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v20.15.0
1+
v22.14.0

Dockerfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
FROM node:20.15.0-bookworm-slim AS base
2-
RUN adduser --disabled-password -home /home/cfu -shell /bin/bash cfu
3-
WORKDIR /root/cf-runtime
4-
COPY package.json yarn.lock ./
1+
ARG NODE_VERSION=22.14.0
2+
FROM node:${NODE_VERSION}-bookworm-slim AS base
3+
WORKDIR /app
54

65
FROM base AS build-dependencies
76
RUN apt-get update \
@@ -11,6 +10,7 @@ RUN apt-get update \
1110
git \
1211
make \
1312
python3
13+
COPY package.json yarn.lock ./
1414

1515
FROM build-dependencies AS build
1616
RUN yarn install --frozen-lockfile
@@ -20,12 +20,12 @@ RUN yarn build
2020
FROM build-dependencies AS prod-dependencies
2121
RUN yarn install --frozen-lockfile --production
2222

23-
FROM base AS production
24-
COPY --from=prod-dependencies /root/cf-runtime/node_modules ./node_modules
25-
COPY --from=build /root/cf-runtime/dist ./lib
23+
FROM base AS final
24+
# purpose of security
25+
RUN npm uninstall -g --logs-max=0 corepack npm
26+
USER node
2627

27-
#purpose of security
28-
RUN npm -g uninstall npm
28+
COPY --from=prod-dependencies --chown=node:node /app/node_modules node_modules
29+
COPY --from=build --chown=node:node /app/dist lib
2930

30-
USER cfu
3131
CMD ["node", "lib/index.js"]

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"typescript": "^5.7.2"
4545
},
4646
"engines": {
47-
"node": ">=16.20.2 <=20"
47+
"node": "^22.14.0"
4848
},
4949
"scripts": {
5050
"lint": "eslint '*/**/*.{j,t}s'",

service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version: 1.12.2
1+
version: 1.12.3

0 commit comments

Comments
 (0)