2020-09-26 16:23:27 +00:00
|
|
|
# Docker/Kubernetes file for running the image API
|
|
|
|
|
|
|
|
FROM node:alpine
|
|
|
|
|
2020-12-08 02:40:17 +00:00
|
|
|
RUN apk --no-cache upgrade
|
|
|
|
RUN apk add --no-cache git msttcorefonts-installer python3 alpine-sdk ffmpeg \
|
|
|
|
zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev fontconfig-dev perl-dev \
|
|
|
|
ghostscript-dev libtool tiff-dev lcms2-dev libwebp-dev libxml2-dev libx11-dev \
|
|
|
|
libxext-dev chrpath libheif-dev pango-dev freetype fontconfig ghostscript \
|
|
|
|
ghostscript-fonts lcms2 graphviz
|
|
|
|
|
|
|
|
# install imagemagick from source rather than using the package
|
|
|
|
# since the alpine package does not include pango support.
|
|
|
|
RUN git clone https://github.com/ImageMagick/ImageMagick.git ImageMagick \
|
|
|
|
&& cd ImageMagick \
|
|
|
|
&& git checkout 7.0.10-45 \
|
|
|
|
&& ./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--mandir=/usr/share/man \
|
|
|
|
--infodir=/usr/share/info \
|
|
|
|
--enable-static \
|
|
|
|
--disable-openmp \
|
|
|
|
--with-threads \
|
|
|
|
--with-x \
|
|
|
|
--with-tiff \
|
|
|
|
--with-png \
|
|
|
|
--with-webp \
|
|
|
|
--with-gslib \
|
|
|
|
--with-gs-font-dir=/usr/share/fonts/Type1 \
|
|
|
|
--with-heic \
|
|
|
|
--with-modules \
|
|
|
|
--with-xml \
|
|
|
|
--with-perl \
|
|
|
|
--with-perl-options="PREFIX=/usr INSTALLDIRS=vendor" \
|
|
|
|
--with-pango \
|
|
|
|
&& make \
|
|
|
|
&& sudo make install
|
2020-09-26 16:23:27 +00:00
|
|
|
|
|
|
|
RUN update-ms-fonts && fc-cache -f
|
|
|
|
|
|
|
|
RUN adduser esmBot -s /bin/sh -D
|
|
|
|
WORKDIR /home/esmBot/.internal
|
2020-12-08 02:40:17 +00:00
|
|
|
|
|
|
|
COPY ./package.json package.json
|
|
|
|
COPY ./package-lock.json package-lock.json
|
2020-09-26 16:23:27 +00:00
|
|
|
RUN npm install
|
2020-12-08 02:40:17 +00:00
|
|
|
COPY . .
|
2020-09-26 16:23:27 +00:00
|
|
|
RUN npm run build
|
|
|
|
USER esmBot
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ENTRYPOINT ["node", "api/index.js"]
|