2020-12-08 02:40:17 +00:00
|
|
|
# Docker/Kubernetes file for running the bot
|
|
|
|
|
|
|
|
FROM node:alpine
|
|
|
|
|
|
|
|
RUN apk --no-cache upgrade
|
|
|
|
RUN apk add --no-cache git msttcorefonts-installer python3 alpine-sdk ffmpeg \
|
2020-12-25 15:47:22 +00:00
|
|
|
zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev fontconfig-dev \
|
2021-03-04 15:05:19 +00:00
|
|
|
libtool libwebp-dev libxml2-dev pango-dev freetype fontconfig \
|
|
|
|
vips vips-dev
|
2020-12-08 02:40:17 +00:00
|
|
|
|
2021-01-21 02:20:04 +00:00
|
|
|
# liblqr needs to be built manually for magik to work
|
|
|
|
# and because alpine doesn't have it in their repos
|
|
|
|
RUN git clone https://github.com/carlobaldassi/liblqr \
|
|
|
|
&& cd liblqr \
|
|
|
|
&& ./configure \
|
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
2020-12-08 02:40:17 +00:00
|
|
|
# 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-png \
|
|
|
|
--with-webp \
|
|
|
|
--with-modules \
|
|
|
|
--with-pango \
|
2020-12-25 15:47:22 +00:00
|
|
|
--without-hdri \
|
2021-01-21 02:20:04 +00:00
|
|
|
--with-lqr \
|
2020-12-08 02:40:17 +00:00
|
|
|
&& make \
|
2021-01-21 02:20:04 +00:00
|
|
|
&& make install
|
2020-12-08 02:40:17 +00:00
|
|
|
|
|
|
|
RUN update-ms-fonts && fc-cache -f
|
|
|
|
|
|
|
|
RUN adduser esmBot -s /bin/sh -D
|
|
|
|
WORKDIR /home/esmBot/.internal
|
2020-12-11 22:46:05 +00:00
|
|
|
|
2020-12-25 15:47:22 +00:00
|
|
|
COPY ./assets/caption.otf /usr/share/fonts/caption.otf
|
|
|
|
COPY ./assets/caption2.ttf /usr/share/fonts/caption2.ttf
|
|
|
|
COPY ./assets/hbc.ttf /usr/share/fonts/hbc.ttf
|
2021-04-26 14:47:03 +00:00
|
|
|
COPY ./assets/reddit.ttf /usr/share/fonts/reddit.ttf
|
2020-12-25 15:47:22 +00:00
|
|
|
RUN fc-cache -fv
|
2020-12-11 22:46:05 +00:00
|
|
|
|
2020-12-22 23:20:05 +00:00
|
|
|
COPY --chown=node:node ./package.json package.json
|
|
|
|
COPY --chown=node:node ./package-lock.json package-lock.json
|
2020-12-08 02:40:17 +00:00
|
|
|
RUN npm install
|
|
|
|
COPY . .
|
2020-12-25 15:47:22 +00:00
|
|
|
RUN npm run build
|
2020-12-08 02:40:17 +00:00
|
|
|
USER esmBot
|
|
|
|
|
2020-12-22 23:20:05 +00:00
|
|
|
ENTRYPOINT ["node", "app.js"]
|