2020-12-08 02:40:17 +00:00
|
|
|
# Docker/Kubernetes file for running the bot
|
|
|
|
FROM node:alpine
|
|
|
|
|
2021-05-14 02:56:14 +00:00
|
|
|
RUN apk --no-cache upgrade
|
2021-12-31 04:45:32 +00:00
|
|
|
RUN apk add --no-cache git cmake msttcorefonts-installer python3 alpine-sdk ffmpeg \
|
2021-05-14 02:56:14 +00:00
|
|
|
zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev fontconfig-dev \
|
|
|
|
libtool libwebp-dev libxml2-dev pango-dev freetype fontconfig \
|
|
|
|
vips vips-dev
|
|
|
|
|
|
|
|
# liblqr needs to be built manually for magick 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
|
|
|
|
|
|
|
|
# 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 \
|
|
|
|
&& ./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 \
|
|
|
|
--without-hdri \
|
|
|
|
--with-lqr \
|
|
|
|
&& make \
|
|
|
|
&& make install
|
|
|
|
|
|
|
|
RUN update-ms-fonts && fc-cache -f
|
|
|
|
|
|
|
|
RUN adduser esmBot -s /bin/sh -D
|
|
|
|
WORKDIR /home/esmBot/.internal
|
|
|
|
|
|
|
|
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
|
|
|
|
COPY ./assets/reddit.ttf /usr/share/fonts/reddit.ttf
|
|
|
|
RUN fc-cache -fv
|
|
|
|
|
|
|
|
COPY --chown=node:node ./package.json package.json
|
|
|
|
COPY --chown=node:node ./package-lock.json package-lock.json
|
|
|
|
RUN npm install
|
|
|
|
COPY . .
|
2021-09-13 18:05:22 +00:00
|
|
|
RUN rm .env
|
2021-05-14 02:56:14 +00:00
|
|
|
RUN npm run build
|
2020-12-08 02:40:17 +00:00
|
|
|
|
2022-01-30 03:05:57 +00:00
|
|
|
RUN mkdir /home/esmBot/help
|
|
|
|
RUN chown esmBot:esmBot /home/esmBot/help
|
2022-01-30 19:15:10 +00:00
|
|
|
RUN chmod 666 /home/esmBot/help
|
2022-01-29 21:20:42 +00:00
|
|
|
|
2022-01-30 03:05:57 +00:00
|
|
|
RUN mkdir /home/esmBot/temp
|
|
|
|
RUN chown esmBot:esmBot /home/esmBot/temp
|
2022-01-30 19:15:10 +00:00
|
|
|
RUN chmod 666 /home/esmBot/temp
|
2022-01-29 21:20:42 +00:00
|
|
|
|
2020-12-08 02:40:17 +00:00
|
|
|
USER esmBot
|
|
|
|
|
2020-12-22 23:20:05 +00:00
|
|
|
ENTRYPOINT ["node", "app.js"]
|