2021年3月6日星期六

installing puppeteer and npm files | docker image

I am trying to deploy my node.js app to Digital Ocean Apps, however, my application requires Puppeteer, and thus this won't work.

To bypass this, I am trying to create a docker file, and then upload to Digital Ocean, however, when I do so, I get the following error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory

I am new to creating docker files, and this is the Dockerimage that is in my node app:

FROM node:14.15  ENV NODE_ENV=production    # Create app directory  WORKDIR /    # Install app dependencies  # A wildcard is used to ensure both package.json AND package-lock.json are copied  # where available (npm@5+)  COPY ["package.json", "package-lock.json*", "./"]    RUN npm install --production  # If you are building your code for production  # RUN npm ci --only=production    # Bundle app source  COPY . .    EXPOSE 3000  CMD [ "node", "server.js" ]  

I am then creating a docker image out of my entire working file, before pushing it to Digital Ocean.

Am I pulling in / installing my npm packages correctly for puppeteer to be included in this? I read something online about apt install, but unsure as to how this comes into play, or how to include this.

https://stackoverflow.com/questions/66512805/installing-puppeteer-and-npm-files-docker-image March 07, 2021 at 11:01AM

没有评论:

发表评论