Skip to content

Commit

Permalink
new Dockerfile for new sharp version
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubber1Duck committed Nov 20, 2023
1 parent 2f52902 commit da8ac0b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 40 deletions.
39 changes: 19 additions & 20 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,32 @@ FROM node:16-alpine3.16
ENV CFLAGS=-O3
ENV CXXFLAGS=-O3

ARG VIPS_VERSION=8.12.2
ARG VIPS_VERSION=8.14.5

# System update, build dependencies, compile vips-8.11.x and cleanup.
# System update, build dependencies, compile vips-x.xx.x and cleanup.
RUN set -x -o pipefail \
&& wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz | tar xzC /tmp \
&& wget -O- https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.xz | tar xJC /tmp \
&& apk update \
&& apk upgrade \
&& apk add \
zlib libxml2 glib gobject-introspection libjpeg-turbo \
libexif lcms2 fftw giflib libpng libwebp orc tiff poppler-glib \
librsvg libgsf openexr libheif libimagequant pango fontconfig \
lcms2 fftw giflib libpng orc tiff poppler-glib \
librsvg libimagequant pango fontconfig \
&& apk add --virtual .ms-fonts msttcorefonts-installer \
&& update-ms-fonts 2>/dev/null \
&& fc-cache -f \
&& apk del .ms-fonts\
&& apk add \
--virtual .vips-dependencies build-base binutils zlib-dev \
libxml2-dev glib-dev gobject-introspection-dev libjpeg-turbo-dev \
libexif-dev lcms2-dev fftw-dev giflib-dev libpng-dev libwebp-dev \
orc-dev tiff-dev poppler-dev librsvg-dev libgsf-dev openexr-dev \
libheif-dev libimagequant-dev pango-dev py-gobject3-dev \
--virtual .vips-dependencies meson build-base binutils \
zlib-dev libxml2-dev glib-dev gobject-introspection-dev libjpeg-turbo-dev \
lcms2-dev fftw-dev giflib-dev libpng-dev orc-dev tiff-dev poppler-dev \
librsvg-dev libimagequant-dev pango-dev py-gobject3-dev \
&& cd /tmp/vips-${VIPS_VERSION} \
&& ./configure --prefix=/usr \
--disable-static \
--disable-dependency-tracking \
--enable-silent-rules \
&& make -sj4 install-strip \
&& cd .. \
&& meson setup build --prefix=/usr --buildtype release \
&& cd build \
&& meson compile \
&& meson install \
&& cd ../../ \
&& rm -rf /tmp/vips-${VIPS_VERSION} \
&& apk del --purge .vips-dependencies \
&& rm -rf /var/cache/apk/*
Expand All @@ -48,15 +46,16 @@ COPY ./package*.json ./
# against globaly installed lib vips in newest version
# Install the buildtools, dev packages of the required shared libs
# execute "npm install" and remove the buildtools and dev packages afterwards
RUN apk add --no-cache --virtual .vips-deps build-base binutils zlib-dev libxml2-dev glib-dev gobject-introspection-dev \
libjpeg-turbo-dev libexif-dev lcms2-dev fftw-dev giflib-dev libpng-dev libwebp-dev orc-dev tiff-dev \
poppler-dev librsvg-dev libgsf-dev openexr-dev libheif-dev libimagequant-dev pango-dev py-gobject3-dev \
RUN apk add \
--virtual .vips-deps meson build-base binutils \
zlib-dev libxml2-dev glib-dev gobject-introspection-dev libjpeg-turbo-dev \
lcms2-dev fftw-dev giflib-dev libpng-dev orc-dev tiff-dev poppler-dev \
librsvg-dev libimagequant-dev pango-dev py-gobject3-dev \
&& npm install \
&& apk del .vips-deps

# If you are building your code for production
# RUN npm ci --only=production

RUN npm install pm2 --location=global

# Bundle app source
Expand Down
23 changes: 4 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"license": "ISC",
"dependencies": {
"@marlon360/express-queue": "^1.0.3",
"@types/sharp": "^0.30.5",
"axios": "^1.3.2",
"compression": "^1.7.4",
"cors": "^2.8.5",
Expand Down

0 comments on commit da8ac0b

Please sign in to comment.