Install GitHub dependency using PNPM in Dockerfile

Viewed 323

I'm using pnpm in Dockerfile I have one dependency which is installed from GitHub.
PNPM by default use yarn to install dependency from Git.
Problem with PNPM is it is not able to access the yarn, I think some kind of permission problem.

ERROR:
ERR_PNPM_PREPARE_PKG_FAILURE  Command failed with exit code 1: /usr/local/bin/yarn install
The command '/bin/sh -c pnpm install' returned a non-zero code: 1

Here is my Dockerfile

FROM node:alpine

RUN npm install -g pnpm

WORKDIR /app

COPY ["package.json", "pnpm-lock.yaml", "./"]

RUN pnpm install

COPY . .

RUN pnpm build

ENV PORT=8080

EXPOSE 80

CMD [ "node", "./build/index.js" ]

Update

This is repo that is used from GitHub. Baileys

Everything works perfect when I try to install packages without Dockerfile If I run pnpm install everything just works. But When I run the build command for Dockerfile it will create problem.
docker build -t name .

0 Answers
Related