From 329c8a7dca43c0f69ee43a1bbaf277c240085bac Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 28 Oct 2021 23:12:23 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20Switched=20to=20an=20alpine=20ba?= =?UTF-8?q?se=20image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 28 +++++++++++++++------------- services/api.service.ts | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index ffbd5c1..cd8dd48 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,26 +1,28 @@ -FROM node:buster-slim +FROM jeanblanchard/alpine-glibc # Show all node logs ENV NPM_CONFIG_LOGLEVEL warn ENV NODE_ENV=production - +ENV CALIBRE_INSTALLER_SOURCE_CODE_URL https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py WORKDIR /threetwo-import-service -RUN apt-get update \ - && apt-get upgrade -y \ - && apt-get install -y \ - bash git openssh-server \ +RUN apk update && \ + apk add --no-cache --upgrade \ + bash \ ca-certificates \ gcc \ - libgl1-mesa-glx \ - python3 python3-pip \ - qtbase5-dev \ + dcron \ + imagemagick \ + mesa-gl \ + python3 \ + qt5-qtbase-x11 \ wget \ + nodejs \ + npm \ xdg-utils \ - xz-utils \ - libvips-dev build-essential - -RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin install_dir=/opt isolated=y && \ + xvfb \ + xz && \ + wget -O- ${CALIBRE_INSTALLER_SOURCE_CODE_URL} | python3 -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main(install_dir='/opt', isolated=True)" && \ rm -rf /tmp/calibre-installer-cache COPY package.json package-lock.json ./ diff --git a/services/api.service.ts b/services/api.service.ts index 4899059..c1c5b5a 100644 --- a/services/api.service.ts +++ b/services/api.service.ts @@ -96,7 +96,7 @@ export default class ApiService extends Service { started(): any { // Socket gateway-ish // Create a Socket.IO instance, passing it our server - socketServer.listen(3001, "0.0.0.0"); + socketServer.listen(3001, SOCKET_HOST); this.io = new Server(socketServer, {}); // Add a connect listener