Skip to content

feat: Align runtime images #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v20.15.0
v22.14.0
20 changes: 10 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
FROM node:20.15.0-bookworm-slim AS base
RUN adduser --disabled-password -home /home/cfu -shell /bin/bash cfu
WORKDIR /root/cf-runtime
COPY package.json yarn.lock ./
ARG NODE_VERSION=22.14.0
FROM node:${NODE_VERSION}-bookworm-slim AS base
WORKDIR /app

FROM base AS build-dependencies
RUN apt-get update \
Expand All @@ -11,6 +10,7 @@ RUN apt-get update \
git \
make \
python3
COPY package.json yarn.lock ./

FROM build-dependencies AS build
RUN yarn install --frozen-lockfile
Expand All @@ -20,12 +20,12 @@ RUN yarn build
FROM build-dependencies AS prod-dependencies
RUN yarn install --frozen-lockfile --production

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

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

USER cfu
CMD ["node", "lib/index.js"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"typescript": "^5.7.2"
},
"engines": {
"node": ">=16.20.2 <=20"
"node": "^22.14.0"
},
"scripts": {
"lint": "eslint '*/**/*.{j,t}s'",
Expand Down
2 changes: 1 addition & 1 deletion service.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version: 1.12.2
version: 1.12.3