I have a turborepo monorepo, using yarn workspaces which looks like this
├── packages
│ ├── server-common
├── services
│ ├── auth
Services/auth is dependant on packages/server-common and using yarn workspaces, imports it like so
"dependencies": {
"server-common": "*",
}
I want to build a docker image out of services/auth, however packages/server-common is not hosted on npm, it is a local package.
Hence, when building the following dockerfile
FROM node:16-alpine
WORKDIR /app
COPY package.json .
RUN yarn install --production
COPY . .
CMD ["npm", "start"]
It fails on the yarn install stage, because docker is trying to download a package from npm, when it is a local package.
#9 8.441 error Received malformed response from registry for "server-common". The registry may be down.
Is there a way that this local package can be included in the docker build?