You've already forked pigallery2
mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-11-25 22:32:52 +02:00
Add HEIC support for the debian based docker builds
This commit is contained in:
@@ -1,11 +1,67 @@
|
||||
#-----------------BUILDER-----------------
|
||||
#-----------------------------------------
|
||||
FROM node:22-bookworm AS builder
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends libvips-dev python3
|
||||
|
||||
|
||||
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 biuld dependencies
|
||||
RUN apt-get install -y curl python3 git build-essential pkg-config && \
|
||||
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
|
||||
|
||||
# Install vips dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
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
|
||||
|
||||
|
||||
# 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 --unsafe-perm --fetch-timeout=90000 && \
|
||||
mkdir -p /app/data/config && \
|
||||
RUN npm install --no-package-lock --save-dev node-addon-api node-gyp
|
||||
RUN npm install --no-package-lock --build-from-source sharp && \
|
||||
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
|
||||
|
||||
@@ -1,11 +1,67 @@
|
||||
#-----------------BUILDER-----------------
|
||||
#-----------------------------------------
|
||||
FROM node:22-bullseye AS builder
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends libvips-dev python3
|
||||
|
||||
|
||||
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 biuld dependencies
|
||||
RUN apt-get install -y curl python3 git build-essential pkg-config && \
|
||||
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
|
||||
|
||||
# Install vips dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
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
|
||||
|
||||
|
||||
# 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 --unsafe-perm --fetch-timeout=90000 && \
|
||||
mkdir -p /app/data/config && \
|
||||
RUN npm install --no-package-lock --save-dev node-addon-api node-gyp
|
||||
RUN npm install --no-package-lock --build-from-source sharp && \
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user