1

I am using the npm module chartjs-node-canvas to create the chart and add it to my xlsx file . I am getting the wanted result without running my app as a dokcer container . Here the result got after running my app with docker : enter image description here

And here is my Dockerfile :

FROM node:16.13.1-alpine3.13
RUN apk add dumb-init
RUN apk update
RUN apk upgrade
RUN apk add --no-cache  pixman
RUN apk add --no-cache libc6-compat && ln -s /lib/libc.musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2
RUN apk add --no-cache  libuuid
RUN apk add --no-cache  glib
RUN apk add --update  autoconf gcc g++ make libaio-dev libnsl gettext-dev automake libtool libc6-compat
RUN apk add --update libaio libnsl &&  ln -s /usr/lib/libnsl.so.2 /usr/lib/libnsl.so.1
RUN apk add musl-dev libaio autoconf && apk add --update make
RUN apk add --update && apk add --no-cache ffmpeg opus pixman cairo pango giflib ca-certificates  && apk add --no-cache --virtual .build-deps git curl build-base jpeg-dev pixman-dev
RUN apk --no-cache --virtual .canvas-build-deps add  build-base  cairo-dev  jpeg-dev  pango-dev  giflib-dev  pixman-dev pangomm-dev libjpeg-turbo-dev freetype-dev  && apk --no-cache add  pixman  cairo  pango  giflib
RUN apk --no-cache --virtual .canvas-build-deps add build-base  cairo-dev jpeg-dev pango-dev  giflib-dev pixman-dev  pangomm-dev  libjpeg-turbo-dev  freetype-dev 
RUN apk --no-cache add pixman  cairo  pango  giflib
  • 1
    That Dockerfile doesn't seem to include any Javascript code, just a large number of host OS dependencies (largely oriented around a C toolchain). Can you [edit] the question to include a [mcve]? – David Maze Feb 28 '22 at 11:36
  • Please provide enough code so others can better understand or reproduce the problem. – Community Feb 28 '22 at 14:48
  • The problem is not about the javascript code of charjs , because it works fine when i run the project with pm2 or with node command directly on my ubuntu 20 system . It is about this docker image 'node:16.13.1-alpine3.13' – chiheb bel haj ali Mar 01 '22 at 12:47

1 Answers1

2

I don't know exactly why but I was experiencing the same issue with node:16-alpine and it was fixed by using node:16.