During the build, the dockerfile will pull across the node_modules directory to the final image. This has a few ramifications:
- Assumes Yarn 1/2 is being used
- Yarn 3
pnp stores packages in .yarn instead
- Yarn 3 can be set to use the
node_modules linker which still stores packages in node_modules, but requires overriding through .yarnrc.yml, which is also not copied across in the Dockerfile
This should probably be a config option (yarn classic/modern):
Classic: copies node_modules across
Modern: copies .yarn and .yarnrc.yml, and respects node-linker, which means copying either node_modules or .yarn across