Skip to content

Commit

Permalink
Merge pull request #2 from immich-app/refactor/reduce-layers
Browse files Browse the repository at this point in the history
refactor: reduce number of layers
  • Loading branch information
bo0tzz authored Oct 12, 2023
2 parents 59a8293 + 5efa750 commit 7b46bdb
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 14 deletions.
104 changes: 90 additions & 14 deletions server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,94 @@ FROM node:20.8-bookworm

WORKDIR /usr/src/app

COPY bin/install-ffmpeg.sh build-lock.json ./
RUN sed -i -e's/ main/ main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources
RUN apt-get update && apt-get install -yqq build-essential ninja-build meson pkg-config jq zlib1g autoconf \
libglib2.0-dev libexpat1-dev librsvg2-dev libexif-dev libwebp-dev liborc-0.4-dev \
libjpeg62-turbo-dev libgsf-1-dev libspng-dev libjxl-dev libheif-dev liblcms2-2 \
mesa-va-drivers libmimalloc2.0 $(if [ $(arch) = "x86_64" ]; then echo "intel-media-va-driver-non-free"; fi) \
&& ./install-ffmpeg.sh && apt-get autoremove && apt-get clean && rm -rf /var/lib/apt/lists/*
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH \
LD_RUN_PATH=/usr/local/lib:$LD_RUN_PATH

# debian build for imagemagick has broken RAW support, so build manually
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
ENV LD_RUN_PATH=/usr/local/lib:$LD_RUN_PATH
COPY bin/build-libraw.sh bin/build-imagemagick.sh bin/build-libvips.sh bin/use-camera-wb.patch ./
RUN ./build-libraw.sh
RUN ./build-imagemagick.sh
RUN ./build-libvips.sh
COPY bin/* .

RUN sed -i -e's/ main/ main contrib non-free non-free-firmware/g' /etc/apt/sources.list.d/debian.sources && \
apt-get update && \
echo "**** install build packages ****" && \
apt-get install --no-install-recommends -yqq \
autoconf \
build-essential \
jq \
libexif-dev \
libexpat1-dev \
libglib2.0-dev \
libgsf-1-dev \
libheif-dev \
libjpeg62-turbo-dev \
libjxl-dev \
liblcms2-2 \
liborc-0.4-dev \
librsvg2-dev \
libspng-dev \
libwebp-dev \
meson \
ninja-build \
pkg-config && \
echo "**** install runtime packages ****" && \
apt-get install --no-install-recommends -yqq \
$(if [ $(arch) = "x86_64" ]; then echo "intel-media-va-driver-non-free"; fi) \
libexif12 \
libexpat1 \
libgcc-s1 \
libglib2.0-0 \
libgomp1 \
libgsf-1-114 \
libheif1 \
libjpeg62-turbo \
libjxl0.7 \
liblcms2-2 \
liblqr-1-0 \
libltdl7 \
libmimalloc2.0 \
libopenexr-3-1-30 \
libopenjp2-7 \
liborc-0.4-0 \
libpng16-16 \
librsvg2-2 \
libspng0 \
libwebp7 \
libwebpdemux2 \
libwebpmux3 \
mesa-va-drivers \
tini \
wget \
zlib1g && \
echo "**** build dependencies ****" && \
./install-ffmpeg.sh && \
./build-libraw.sh && \
./build-imagemagick.sh && \
./build-libvips.sh && \
echo "**** cleanup ****" && \
rm -f \
build-* \
install-ffmpeg.sh \
use-camera-web.patch && \
apt-get remove -y --purge \
autoconf \
build-essential \
jq \
libexif-dev \
libexpat1-dev \
libglib2.0-dev \
libgsf-1-dev \
libheif-dev \
libjpeg62-turbo-dev \
libjxl-dev \
liborc-0.4-dev \
librsvg2-dev \
libspng-dev \
libwebp-dev \
meson \
ninja-build \
pkg-config && \
apt-get autoremove -y --purge && \
apt-get clean && \
rm -rf \
/var/tmp/* \
/var/lib/apt/lists/* \
/root/.cache \
/var/lib/apt/lists/*
File renamed without changes.

0 comments on commit 7b46bdb

Please sign in to comment.