2023-10-03 16:34:35 +02:00
|
|
|
FROM node:20.8-bookworm as builder
|
2022-02-03 22:42:27 +02:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2023-08-02 03:56:10 +02:00
|
|
|
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
|
2023-08-08 12:58:03 +02:00
|
|
|
RUN apt-get update && apt-get install -yqq build-essential ninja-build meson pkg-config jq zlib1g autoconf \
|
2023-08-13 04:02:33 +02:00
|
|
|
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 \
|
2023-08-02 03:56:10 +02:00
|
|
|
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/*
|
|
|
|
|
|
|
|
# debian build for imagemagick has broken RAW support, so build manually
|
2023-08-08 12:58:03 +02:00
|
|
|
ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
|
|
|
|
ENV LD_RUN_PATH=/usr/local/lib:$LD_RUN_PATH
|
2023-08-21 01:26:01 +02:00
|
|
|
COPY bin/build-libraw.sh bin/build-imagemagick.sh bin/build-libvips.sh bin/use-camera-wb.patch ./
|
2023-08-08 12:58:03 +02:00
|
|
|
RUN ./build-libraw.sh
|
2023-08-02 03:56:10 +02:00
|
|
|
RUN ./build-imagemagick.sh
|
|
|
|
RUN ./build-libvips.sh
|
2022-11-10 03:53:21 +02:00
|
|
|
|
2022-02-07 23:06:30 +02:00
|
|
|
COPY package.json package-lock.json ./
|
2022-02-03 22:42:27 +02:00
|
|
|
|
2022-07-04 20:47:25 +02:00
|
|
|
RUN npm ci
|
2022-02-03 22:42:27 +02:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2022-11-11 06:22:17 +02:00
|
|
|
FROM builder as prod
|
|
|
|
|
2022-06-07 15:08:22 +02:00
|
|
|
RUN npm run build
|
2023-02-03 05:28:34 +02:00
|
|
|
RUN npm prune --omit=dev --omit=optional
|
2022-11-11 06:22:17 +02:00
|
|
|
|
2023-10-03 16:34:35 +02:00
|
|
|
FROM node:20.8-bookworm
|
2023-04-03 22:05:29 +02:00
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
2022-08-21 06:19:02 +02:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2023-08-02 03:56:10 +02:00
|
|
|
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 tini libheif1 libwebp7 libwebpdemux2 libwebpmux3 mesa-va-drivers \
|
2023-08-13 04:02:33 +02:00
|
|
|
libjpeg62-turbo libexpat1 librsvg2-2 libjxl0.7 libspng0 libexif12 libgcc-s1 libglib2.0-0 \
|
2023-08-08 12:58:03 +02:00
|
|
|
libgsf-1-114 libopenjp2-7 liblcms2-2 liborc-0.4-0 libopenexr-3-1-30 liblqr-1-0 libltdl7 zlib1g libgomp1 \
|
2023-08-02 03:56:10 +02:00
|
|
|
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=prod /usr/local/lib/ /usr/local/lib/
|
|
|
|
RUN ldconfig /usr/local/lib
|
2022-08-21 06:19:02 +02:00
|
|
|
|
2022-11-11 06:22:17 +02:00
|
|
|
COPY --from=prod /usr/src/app/node_modules ./node_modules
|
|
|
|
COPY --from=prod /usr/src/app/dist ./dist
|
|
|
|
COPY --from=prod /usr/src/app/bin ./bin
|
2022-08-21 06:19:02 +02:00
|
|
|
|
2022-11-10 03:53:21 +02:00
|
|
|
COPY LICENSE /licenses/LICENSE.txt
|
|
|
|
COPY LICENSE /LICENSE
|
|
|
|
COPY package.json package-lock.json ./
|
2023-06-08 17:01:07 +02:00
|
|
|
COPY start*.sh ./
|
2022-08-21 06:19:02 +02:00
|
|
|
|
2023-02-03 05:28:34 +02:00
|
|
|
RUN npm link && npm cache clean --force
|
2022-10-01 23:01:27 +02:00
|
|
|
VOLUME /usr/src/app/upload
|
|
|
|
|
2022-11-05 18:28:40 +02:00
|
|
|
EXPOSE 3001
|
2023-05-23 16:02:47 +02:00
|
|
|
|
2023-07-21 16:20:04 +02:00
|
|
|
ENTRYPOINT ["tini", "--", "/bin/sh"]
|