37 lines
1.0 KiB
Docker
37 lines
1.0 KiB
Docker
ARG NODE_VERSION=24
|
|
ARG UBUNTU_VERSION=26.04
|
|
|
|
FROM node:${NODE_VERSION}-bookworm-slim AS web
|
|
WORKDIR /web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
FROM ubuntu:${UBUNTU_VERSION}
|
|
ARG HOST_UID
|
|
ARG HOST_GID
|
|
|
|
RUN apt-get update \
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
|
build-essential \
|
|
dpkg-dev \
|
|
debhelper \
|
|
lintian \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /build
|
|
COPY debian-package/ src/
|
|
COPY docs/ src/docs/
|
|
COPY --from=web /web/dist src/web/dist/
|
|
# DEB_VERSION, when set, replaces the version of the newest changelog entry in the image only.
|
|
ARG DEB_VERSION
|
|
RUN if [ -n "$DEB_VERSION" ]; then sed -i "1s/([^)]*)/($DEB_VERSION)/" src/debian/changelog; fi
|
|
RUN cd src && dpkg-buildpackage -us -uc -b
|
|
|
|
RUN lintian --no-tag-display-limit /build/*.changes || true
|
|
|
|
RUN mkdir /out \
|
|
&& find /build -maxdepth 1 \( -name '*.deb' -o -name '*.buildinfo' -o -name '*.changes' \) \
|
|
-exec install -o "$HOST_UID" -g "$HOST_GID" -m 0644 {} /out/ \;
|