-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* build: reduce image size; upgrade node * build(Dockerfile): fix `as` casing
- Loading branch information
1 parent
20aa3e1
commit 0ac8a9b
Showing
2 changed files
with
15 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,21 @@ | ||
FROM node:20.8.1-bookworm-slim | ||
|
||
FROM node:20.15.0-bookworm-slim AS base | ||
RUN adduser --disabled-password -home /home/cfu -shell /bin/bash cfu | ||
WORKDIR /root/cf-runtime | ||
|
||
RUN apt-get update && apt upgrade -y && \ | ||
apt-get install g++ git make python3 -y | ||
|
||
COPY package.json yarn.lock ./ | ||
|
||
# install cf-runtime required binaries | ||
RUN yarn install --frozen-lockfile --production && \ | ||
yarn cache clean && \ | ||
apt-get purge g++ git make python3 -y && \ | ||
apt-get autoremove -y && \ | ||
apt-get clean -y && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /var/lib/apt/lists/* | ||
FROM base AS dependencies | ||
RUN apt-get update \ | ||
&& apt upgrade -y \ | ||
&& apt-get install -y \ | ||
g++ \ | ||
git \ | ||
make \ | ||
python3 | ||
RUN yarn install --frozen-lockfile --production | ||
|
||
# copy app files | ||
COPY . ./ | ||
|
||
RUN adduser --disabled-password -home /home/cfu -shell /bin/bash cfu | ||
FROM base AS production | ||
COPY --from=dependencies /root/cf-runtime/node_modules ./node_modules | ||
COPY . . | ||
|
||
USER cfu | ||
|
||
CMD ["node", "lib/index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
version: 1.11.4 | ||
version: 1.11.5 |