From 282e4da983d459d9da3c01778c49c31a2a423f80 Mon Sep 17 00:00:00 2001 From: Sorunome Date: Tue, 9 Feb 2021 18:25:58 +0100 Subject: [PATCH] update dockerfile --- Dockerfile | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6b4febe..38ad786 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,31 @@ -FROM node:latest AS builder +FROM node:alpine AS builder WORKDIR /opt/mx-puppet-skype # run build process as user in case of npm pre hooks # pre hooks are not executed while running as root RUN chown node:node /opt/mx-puppet-skype -USER node +RUN apk --no-cache add git python make g++ pkgconfig \ + build-base \ + cairo-dev \ + jpeg-dev \ + pango-dev \ + musl-dev \ + giflib-dev \ + pixman-dev \ + pangomm-dev \ + libjpeg-turbo-dev \ + freetype-dev + +RUN wget -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub && \ + wget -O glibc-2.32-r0.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.32-r0/glibc-2.32-r0.apk && \ + apk add glibc-2.32-r0.apk COPY package.json package-lock.json ./ +RUN chown node:node package.json package-lock.json + +USER node + RUN npm install COPY tsconfig.json ./ @@ -23,7 +41,17 @@ ENV CONFIG_PATH=/data/config.yaml \ REGISTRATION_PATH=/data/skype-registration.yaml # su-exec is used by docker-run.sh to drop privileges -RUN apk add --no-cache su-exec +RUN apk add --no-cache su-exec \ + cairo \ + jpeg \ + pango \ + musl \ + giflib \ + pixman \ + pangomm \ + libjpeg-turbo \ + freetype + WORKDIR /opt/mx-puppet-skype COPY docker-run.sh ./ @@ -34,4 +62,3 @@ COPY --from=builder /opt/mx-puppet-skype/build/ ./build/ # point to the persisten volume WORKDIR /data ENTRYPOINT ["/opt/mx-puppet-skype/docker-run.sh"] -