Skip to content

Commit 9d3dfb6

Browse files
committed
⬆️(docker) upgrade node images to alpine 3.21
We need to upgrade our images to alpine 3.21 in order to fix a CVE related to libxml2. We also upgrade node to version 24
1 parent 0da042f commit 9d3dfb6

File tree

3 files changed

+29
-4
lines changed

3 files changed

+29
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ and this project adheres to
2121
- 📝(frontend) Update documentation
2222
- ✅(frontend) Improve tests coverage
2323
- ⬆️(docker) upgrade backend image to python 3.13 #973
24+
- ⬆️(docker) upgrade node images to alpine 3.21
2425

2526

2627
### Removed

src/frontend/Dockerfile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
FROM node:20-alpine AS frontend-deps
1+
FROM node:24-alpine AS frontend-deps
2+
3+
# Upgrade system packages to install security updates
4+
RUN apk update && \
5+
apk upgrade && \
6+
rm -rf /var/cache/apk/*
27

38
WORKDIR /home/frontend/
49

@@ -45,7 +50,19 @@ ENV NEXT_PUBLIC_PUBLISH_AS_MIT=${PUBLISH_AS_MIT}
4550
RUN yarn build
4651

4752
# ---- Front-end image ----
48-
FROM nginxinc/nginx-unprivileged:1.26-alpine AS frontend-production
53+
FROM nginxinc/nginx-unprivileged:1.27-alpine AS frontend-production
54+
55+
# Remove the upgrade part once nginx has published
56+
# a new image that fixes the CVE related to libxml2
57+
ARG UID=101
58+
USER root
59+
60+
# Upgrade system packages to install security updates
61+
RUN apk update && \
62+
apk upgrade && \
63+
rm -rf /var/cache/apk/*
64+
65+
USER $UID
4966

5067
# Un-privileged user running the application
5168
ARG DOCKER_USER

src/frontend/servers/y-provider/Dockerfile

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
FROM node:20-alpine AS y-provider-builder
1+
FROM node:22.9-alpine AS base
2+
3+
# Upgrade system packages to install security updates
4+
RUN apk update && \
5+
apk upgrade && \
6+
rm -rf /var/cache/apk/*
7+
8+
FROM base AS y-provider-builder
29

310
WORKDIR /home/frontend/
411

@@ -15,7 +22,7 @@ COPY ./src/frontend/servers/y-provider ./servers/y-provider
1522
WORKDIR /home/frontend/servers/y-provider
1623
RUN yarn build
1724

18-
FROM node:20-alpine AS y-provider
25+
FROM base AS y-provider
1926

2027
WORKDIR /home/frontend/
2128

0 commit comments

Comments
 (0)