Skip to content

Commit

Permalink
Change: Update docker build to use nodejs 18 (LTS) and npm
Browse files Browse the repository at this point in the history
Use current Debian stable (bookworm), nodejs 18 (LTS) and npm to build
and install GSA for the container image. This updates to current
maintained software and removes the extra dependency on yarn.
  • Loading branch information
bjoernricks committed Aug 31, 2023
1 parent 314fb42 commit b8d2f4f
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .docker/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
ARG VERSION=stable
ARG DEBIAN_FRONTEND=noninteractive

FROM --platform=linux/amd64 debian:oldstable-slim as builder
FROM --platform=linux/amd64 debian:stable-slim as builder

ENV NODE_VERSION=node_14.x
ENV NODE_VERSION=node_18.x
ENV NODE_KEYRING=/usr/share/keyrings/nodesource.gpg
ENV DISTRIBUTION=bullseye
ENV YARN_KEYRING=/usr/share/keyrings/yarn.gpg
ENV DISTRIBUTION=bookworm

RUN apt-get update && \
apt-get install -y --no-install-recommends \
Expand All @@ -16,22 +15,16 @@ RUN apt-get update && \

RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | tee "$NODE_KEYRING" >/dev/null && \
echo "deb [signed-by=$NODE_KEYRING] https://deb.nodesource.com/$NODE_VERSION $DISTRIBUTION main" | tee /etc/apt/sources.list.d/nodesource.list
RUN curl -fsSL https://dl.yarnpkg.com/debian/pubkey.gpg | gpg --dearmor | tee "$YARN_KEYRING" >/dev/null && \
echo "deb [signed-by=$YARN_KEYRING] https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list


# Install Debian core dependencies required for building gvm with PostgreSQL
# support and not yet installed as dependencies of gvm-libs-core
RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs \
yarn && \
nodejs && \
rm -rf /var/lib/apt/lists/*

COPY . /source
WORKDIR /source

RUN yarn && yarn build
RUN npm install && npm run build

FROM greenbone/gsad:${VERSION}

Expand Down

0 comments on commit b8d2f4f

Please sign in to comment.