Skip to content

Commit

Permalink
Merge pull request #6 from immich-app/fix/stages
Browse files Browse the repository at this point in the history
Build in two stages
  • Loading branch information
bo0tzz authored Oct 13, 2023
2 parents 735fd57 + a342efd commit 1d1444d
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:20.8-bookworm
FROM node:20.8-bookworm as builder

WORKDIR /usr/src/app

Expand Down Expand Up @@ -93,3 +93,48 @@ RUN sed -i -e's/ main/ main contrib non-free non-free-firmware/g' /etc/apt/sourc
/var/lib/apt/lists/* \
/root/.cache \
/var/lib/apt/lists/*

FROM node:20.8-bookworm

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 && \
apt-get update && \
apt-get install -yqq \
tini \
libheif1 \
libwebp7 \
libwebpdemux2 \
libwebpmux3 \
mesa-va-drivers \
libjpeg62-turbo \
libexpat1 \
librsvg2-2 \
libjxl0.7 \
libspng0 \
libexif12 \
libgcc-s1 \
libglib2.0-0 \
libgsf-1-114 \
libopenjp2-7 \
liblcms2-2 \
liborc-0.4-0 \
libopenexr-3-1-30 \
liblqr-1-0 \
libltdl7 \
zlib1g \
libgomp1 \
mesa-va-drivers \
libmimalloc2.0 \
$(if [ $(arch) = "x86_64" ]; then echo "intel-media-va-driver-non-free"; fi) \
jq \
wget && \
./install-ffmpeg.sh \
&& apt-get remove -yqq jq wget \
&& apt-get autoremove -yqq && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm install-ffmpeg.sh && \
rm build-lock.json

COPY --from=builder /usr/local/lib/ /usr/local/lib/
RUN ldconfig /usr/local/lib

0 comments on commit 1d1444d

Please sign in to comment.