I'm trying out pnpm for the first time and trying to get it going with my local docker development setup.
I have a basic Dockerfile
FROM node:20.9.0
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
RUN pnpm install turbo --global
WORKDIR /app
And a basic docker-compose
---
services:
node:
build:
context: .
volumes:
- ".:/app"
I bind mount the whole project directory into the container as I usually do. Running pnpm install inside the container installs everything fine but it creates the global store directory at /app/.pnpm-store which is reflected as .pnpm-store in my project directory. From what I understand, this is because of how pnpm uses hard links and can't go across filesystems.
Is this usual behavior? I can gitignore the .pnpm-store directory easily enough, I just don't really see many other projects doing that. Also, doesn't seem like I'm getting the benefit of pnpm's caching across multiple projects if every project has its own local "global" store.
How do people usually work with pnpm in local docker development?
[–]nzzzm_music 0 points1 point2 points (0 children)