Skip to content

Commit

Permalink
Use busybox as base image for the frontend component.
Browse files Browse the repository at this point in the history
This reduces the size of the frontend component Docker image from 175MB to less than 6MB.

Closes #10767.
  • Loading branch information
fniessink committed Feb 4, 2025
1 parent b2e49ad commit 8c279d3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
10 changes: 4 additions & 6 deletions components/frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,18 @@ COPY .env /home/frontend
RUN npm install --ignore-scripts && \
npm run --ignore-scripts build

FROM node:23.6.1-alpine3.20
FROM busybox:1.37.0

LABEL maintainer="Quality-time team <quality-time@ictu.nl>"
LABEL description="Quality-time frontend"

WORKDIR /home/frontend
COPY healthcheck.js /home/frontend
COPY --from=compile-image /home/frontend/dist /home/frontend/dist
RUN npm install --ignore-scripts -g serve@14.2.4 && \
adduser frontend --disabled-password
RUN adduser frontend --disabled-password
USER frontend

HEALTHCHECK CMD ["node", "/home/frontend/healthcheck.js"]
HEALTHCHECK CMD wget --spider http://localhost:${FRONTEND_PORT:-5000}/favicon.ico || exit 1

# Use the Shell form of CMD instead of the Exec form so the environment variable is substituted
# hadolint ignore=DL3025
CMD serve --listen ${FRONTEND_PORT:-5000} --no-request-logging --single dist
CMD httpd -f -v -p ${FRONTEND_PORT:-5000} -h dist
2 changes: 1 addition & 1 deletion components/frontend/ci/quality.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ PATH="$PATH:../../ci"
source quality-base.sh

# Eslint
run npx eslint *.js *.mjs src
run npx eslint *.mjs src
19 changes: 0 additions & 19 deletions components/frontend/healthcheck.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ If your currently installed *Quality-time* version is not the latest version, pl

- Use the font configured in the browser instead of the browser's system font. Fixes [#9864](https://github.com/ICTU/quality-time/issues/9864).
- Update SonarQube logo and documentation URLs. Closes [#10766](https://github.com/ICTU/quality-time/issues/10766).
- Use busybox as base image for the frontend component Docker image. This reduces the size of the frontend component image from 175MB to less than 6MB. Closes [#10767](https://github.com/ICTU/quality-time/issues/10767).

## v5.23.0 - 2025-01-27

Expand Down

0 comments on commit 8c279d3

Please sign in to comment.