2020-12-08 02:40:17 +00:00
|
|
|
# Docker/Kubernetes file for running the bot
|
2022-08-11 05:42:39 +00:00
|
|
|
#FROM node:alpine
|
|
|
|
FROM alpine:edge
|
2020-12-08 02:40:17 +00:00
|
|
|
|
2021-05-14 02:56:14 +00:00
|
|
|
RUN apk --no-cache upgrade
|
2022-03-08 23:42:30 +00:00
|
|
|
RUN apk add --no-cache git cmake msttcorefonts-installer python3 alpine-sdk ffmpeg wget rpm2cpio \
|
2021-05-14 02:56:14 +00:00
|
|
|
zlib-dev libpng-dev libjpeg-turbo-dev freetype-dev fontconfig-dev \
|
2022-06-18 00:44:29 +00:00
|
|
|
libtool libwebp-dev libxml2-dev freetype fontconfig \
|
2022-08-11 05:42:39 +00:00
|
|
|
vips vips-dev grep libc6-compat nodejs-current nodejs-current-dev npm
|
2022-06-18 00:44:29 +00:00
|
|
|
|
|
|
|
# install pnpm
|
|
|
|
RUN --mount=type=cache,id=pnpm-store,target=/root/.pnpm-store \
|
|
|
|
npm install -g pnpm@6.27.1
|
2021-05-14 02:56:14 +00:00
|
|
|
|
|
|
|
# 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
|
2022-06-18 00:44:29 +00:00
|
|
|
# since the alpine package does not include liblqr support.
|
2021-05-14 02:56:14 +00:00
|
|
|
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
|
2022-09-23 04:44:54 +00:00
|
|
|
USER esmBot
|
2021-05-14 02:56:14 +00:00
|
|
|
|
2022-09-23 04:44:54 +00:00
|
|
|
WORKDIR /home/esmBot/.internal
|
2021-05-14 02:56:14 +00:00
|
|
|
|
2022-09-23 04:44:54 +00:00
|
|
|
COPY --chown=esmBot:esmBot ./package.json package.json
|
|
|
|
COPY --chown=esmBot:esmBot ./pnpm-lock.yaml pnpm-lock.yaml
|
2022-06-18 00:44:29 +00:00
|
|
|
RUN pnpm install
|
2021-05-14 02:56:14 +00:00
|
|
|
COPY . .
|
2021-09-13 18:05:22 +00:00
|
|
|
RUN rm .env
|
2022-06-18 00:44:29 +00:00
|
|
|
RUN pnpm run build
|
2020-12-08 02:40:17 +00:00
|
|
|
|
2022-06-18 00:44:29 +00:00
|
|
|
RUN mkdir /home/esmBot/help \
|
|
|
|
&& chown esmBot:esmBot /home/esmBot/help \
|
|
|
|
&& chmod 777 /home/esmBot/help
|
2022-01-29 21:20:42 +00:00
|
|
|
|
2022-06-18 00:44:29 +00:00
|
|
|
RUN mkdir /home/esmBot/temp \
|
|
|
|
&& chown esmBot:esmBot /home/esmBot/temp \
|
|
|
|
&& chmod 777 /home/esmBot/temp
|
2022-01-29 21:20:42 +00:00
|
|
|
|
2022-06-18 00:44:29 +00:00
|
|
|
RUN mkdir /home/esmBot/.internal/logs \
|
|
|
|
&& chown esmBot:esmBot /home/esmBot/.internal/logs \
|
|
|
|
&& chmod 777 /home/esmBot/.internal/logs
|
2022-02-23 01:44:13 +00:00
|
|
|
|
2020-12-22 23:20:05 +00:00
|
|
|
ENTRYPOINT ["node", "app.js"]
|