deprecating debian bookwork and bullseye

This commit is contained in:
Patrik J. Braun
2025-10-21 20:19:25 +02:00
parent 479b09668f
commit b63eaaa0a7
6 changed files with 19 additions and 255 deletions
+6 -11
View File
@@ -11,9 +11,9 @@ name: Lint Dockerfiles
on:
push:
branches:
branches:
- '**'
jobs:
dockerfile_linting:
name: Dockerfile linting
@@ -25,18 +25,13 @@ jobs:
with:
dockerfile: ./docker/alpine/Dockerfile.build
config: ./docker/.config/hadolint.yml
- name: Lint Debian Bookworm Dockerfile
- name: Lint Debian Trixie Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./docker/debian-bookworm/Dockerfile.build
dockerfile: ./docker/debian-trixie/Dockerfile.build
config: ./docker/.config/hadolint.yml
- name: Lint Debian Bullseye Dockerfile
- name: Lint Debian Trixie Self-contained Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./docker/debian-bullseye/Dockerfile.build
dockerfile: ./docker/debian-trixie/selfcontained/Dockerfile
config: ./docker/.config/hadolint.yml
- name: Lint Debian Bullseye Self-contained Dockerfile
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: ./docker/debian-bullseye/selfcontained/Dockerfile
config: ./docker/.config/hadolint.yml
+2 -2
View File
@@ -8,10 +8,10 @@ To quality check your dockerfile changes you can use hadolint:
1. Start the docker daemon if it's not already started: `sudo dockerd`
2. Change dir to the docker folder.
3. Run hadolint on the alpine dockerfile: `docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < ./alpine/Dockerfile.build`
4. Run hadolint on the debian-bookworm dockerfile: `docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < ./debian-bookworm/Dockerfile.build`
4. Run hadolint on the debian-trixie dockerfile: `docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < ./debian-trixie/Dockerfile.build`
5. Run hadolint on the debian-bullseye dockerfile: `docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < ./debian-bullseye/Dockerfile.build`
7. Run hadolint on the debian-bullseye selfcontained dockerfile: `docker run --rm -i -v ./.config/hadolint.yml:/.config/hadolint.yaml hadolint/hadolint < ./debian-bullseye/selfcontained/Dockerfile`
8. Fix errors and warnings or add them to ignore list of the [hadolint configuration file](./.config/hadolint.yml) if there is a good reason for that. Read more [here](https://github.com/hadolint/hadolint).
### Building the docker image locally
TBD
TBD
-99
View File
@@ -1,99 +0,0 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:22-bookworm AS builder
ENV SHARP_FORCE_GLOBAL_LIBVIPS=1
# inspired by: https://dev.to/ilyasa1211/converting-heic-image-extension-in-nodejs-with-the-sharp-library-39mg
# also see: https://github.com/bpatrik/pigallery2/issues/965
# Install build and vips dependencies
RUN apt-get update && apt-get install -y curl python3 git build-essential pkg-config \
libexif-dev \
libexpat-dev \
libheif-dev \
libimage-exiftool-perl \
libjpeg62-turbo-dev \
liblcms2-dev \
liborc-dev \
libpng-dev \
librsvg2-dev \
libtiff-dev \
libvips-dev \
libvips42 && \
rm -rf /var/lib/apt/lists/*
# Install ninja
RUN git clone --branch=v1.12.1 --depth=1 https://github.com/ninja-build/ninja.git && \
cd ninja && \
./configure.py --bootstrap && \
chmod +x ninja && \
mv ninja /usr/local/bin/ninja
# Install meson
RUN git clone --branch=1.6.1 --depth=1 https://github.com/mesonbuild/meson.git && \
cd meson && \
./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' && \
chmod +x meson.pyz && \
mv meson.pyz /usr/local/bin/meson
# Build libvips
RUN git clone --branch=v8.17.1 --depth=1 https://github.com/libvips/libvips.git && \
cd libvips && \
meson setup build --prefix /usr/local && \
cd build && \
meson compile && \
meson test && \
meson install && \
ldconfig && \
cd .. && \
rm -rf libvips
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --no-package-lock --save-dev node-addon-api@8.5.0 node-gyp@11.5.0 && \
npm prune --production && \
npm cache clean --force
RUN mkdir -p /app/data/config && \
mkdir -p /app/data/db && \
mkdir -p /app/data/images && \
mkdir -p /app/data/tmp
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:22-bookworm-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
default-Database-dbFolder=/app/data/db \
default-Media-folder=/app/data/images \
default-Media-tempFolder=/app/data/tmp \
default-Extensions-folder=/app/data/config/extensions \
# flagging dockerized environemnt
PI_DOCKER=true
EXPOSE 80
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg libvips42 \
&& if [ "$TARGETARCH" = "amd64" ]; then \
echo "Building for amd64, adding intel-media-va-driver" && \
apt-get install -y --no-install-recommends intel-media-va-driver; \
fi \
&& apt-get clean -q -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app /app
# Run build time diagnostics to make sure the app would work after build is finished
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json", "--Server-Log-level=silly"]
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
CMD wget --quiet --tries=1 --no-check-certificate --spider \
http://127.0.0.1:80/heartbeat || exit 1
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
-99
View File
@@ -1,99 +0,0 @@
#-----------------BUILDER-----------------
#-----------------------------------------
FROM node:22-bullseye AS builder
ENV SHARP_FORCE_GLOBAL_LIBVIPS=1
# inspired by: https://dev.to/ilyasa1211/converting-heic-image-extension-in-nodejs-with-the-sharp-library-39mg
# also see: https://github.com/bpatrik/pigallery2/issues/965
# Install build and vips dependencies
RUN apt-get update && apt-get install -y curl python3 git build-essential pkg-config \
libexif-dev \
libexpat-dev \
libheif-dev \
libimage-exiftool-perl \
libjpeg62-turbo-dev \
liblcms2-dev \
liborc-dev \
libpng-dev \
librsvg2-dev \
libtiff-dev \
libvips-dev \
libvips42 && \
rm -rf /var/lib/apt/lists/*
# Install ninja
RUN git clone --branch=v1.12.1 --depth=1 https://github.com/ninja-build/ninja.git && \
cd ninja && \
./configure.py --bootstrap && \
chmod +x ninja && \
mv ninja /usr/local/bin/ninja
# Install meson
RUN git clone --branch=1.6.1 --depth=1 https://github.com/mesonbuild/meson.git && \
cd meson && \
./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' && \
chmod +x meson.pyz && \
mv meson.pyz /usr/local/bin/meson
# Build libvips
RUN git clone --branch=v8.17.1 --depth=1 https://github.com/libvips/libvips.git && \
cd libvips && \
meson setup build --prefix /usr/local && \
cd build && \
meson compile && \
meson test && \
meson install && \
ldconfig && \
cd .. && \
rm -rf libvips
COPY pigallery2-release /app
WORKDIR /app
RUN npm install --no-package-lock --save-dev node-addon-api@8.5.0 node-gyp@11.5.0 && \
npm prune --production && \
npm cache clean --force
RUN mkdir -p /app/data/config && \
mkdir -p /app/data/db && \
mkdir -p /app/data/images && \
mkdir -p /app/data/tmp
#-----------------MAIN--------------------
#-----------------------------------------
FROM node:22-bullseye-slim AS main
WORKDIR /app
ENV NODE_ENV=production \
# overrides only the default value of the settings (the actualy value can be overwritten through config.json)
default-Database-dbFolder=/app/data/db \
default-Media-folder=/app/data/images \
default-Media-tempFolder=/app/data/tmp \
default-Extensions-folder=/app/data/config/extensions \
# flagging dockerized environemnt
PI_DOCKER=true
EXPOSE 80
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg libvips42 \
&& if [ "$TARGETARCH" = "amd64" ]; then \
echo "Building for amd64, adding intel-media-va-driver" && \
apt-get install -y --no-install-recommends intel-media-va-driver; \
fi \
&& apt-get clean -q -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app /app
# Run build time diagnostics to make sure the app would work after build is finished
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json", "--Server-Log-level=silly"]
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
CMD wget --quiet --tries=1 --no-check-certificate --spider \
http://127.0.0.1:80/heartbeat || exit 1
# after a extensive job (like video converting), pigallery calls gc, to clean up everthing as fast as possible
# Exec form entrypoint is need otherwise (using shell form) ENV variables are not properly passed down to the app
ENTRYPOINT ["node", "./src/backend/index", "--expose-gc", "--config-path=/app/data/config/config.json"]
+1
View File
@@ -16,6 +16,7 @@ RUN apt-get update && apt-get install -y curl python3 git build-essential pkg-co
COPY pigallery2-release /app
WORKDIR /app
# building sharp based on debian's vips
RUN npm install --no-package-lock node-addon-api@8.5.0 node-gyp@11.5.0 && \
mkdir -p /app/data/config && \
mkdir -p /app/data/db && \
+10 -44
View File
@@ -10,48 +10,9 @@ ENV SHARP_FORCE_GLOBAL_LIBVIPS=1
# Install build and vips dependencies
RUN apt-get update && apt-get install -y curl python3 git build-essential pkg-config \
libexif-dev \
libexpat-dev \
libheif-dev \
libimage-exiftool-perl \
libjpeg62-turbo-dev \
liblcms2-dev \
liborc-dev \
libpng-dev \
librsvg2-dev \
libtiff-dev \
libvips-dev \
libvips42 && \
libvips-dev && \
rm -rf /var/lib/apt/lists/*
# Install ninja
RUN git clone --branch=v1.12.1 --depth=1 https://github.com/ninja-build/ninja.git && \
cd ninja && \
./configure.py --bootstrap && \
chmod +x ninja && \
mv ninja /usr/local/bin/ninja
# Install meson
RUN git clone --branch=1.6.1 --depth=1 https://github.com/mesonbuild/meson.git && \
cd meson && \
./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' && \
chmod +x meson.pyz && \
mv meson.pyz /usr/local/bin/meson
# Build libvips
RUN git clone --branch=v8.17.1 --depth=1 https://github.com/libvips/libvips.git && \
cd libvips && \
meson setup build --prefix /usr/local && \
cd build && \
meson compile && \
meson test && \
meson install && \
ldconfig && \
cd .. && \
rm -rf libvips
# copying only package{-lock}.json to make node_modules cachable
RUN git clone https://github.com/bpatrik/pigallery2.git /build
WORKDIR /build
@@ -62,7 +23,7 @@ RUN npm install --unsafe-perm \
&& mkdir -p /build/release/data/tmp \
&& npm run create-release
WORKDIR /build/release
RUN npm install --unsafe-perm
RUN npm install --unsafe-perm --no-package-lock node-addon-api@8.5.0 node-gyp@11.5.0
#-----------------MAIN--------------------
#-----------------------------------------
@@ -78,14 +39,19 @@ ENV NODE_ENV=production \
PI_DOCKER=true
EXPOSE 80
ARG TARGETARCH
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg \
&& apt-get install -y --no-install-recommends ca-certificates wget ffmpeg libvips42 \
&& if [ "$TARGETARCH" = "amd64" ]; then \
echo "Building for amd64, adding intel-media-va-driver" && \
apt-get install -y --no-install-recommends intel-media-va-driver; \
fi \
&& apt-get clean -q -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /build/release /app
COPY --from=builder /app /app
# Run build time diagnostics to make sure the app would work after build is finished
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json"]
RUN ["node", "./src/backend/index", "--expose-gc", "--run-diagnostics", "--config-path=/app/diagnostics-config.json", "--Server-Log-level=silly"]
HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \
CMD wget --quiet --tries=1 --no-check-certificate --spider \
http://127.0.0.1:80/heartbeat || exit 1