vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.55k stars 27.05k forks source link

Example Dockerfile does not copy .npmc / .yarnrc files #71827

Open H4kt opened 1 month ago

H4kt commented 1 month ago

Verify canary release

Provide environment information

Operating System:
  Platform: win32
  Arch: x64
  Version: Windows 11 Pro
  Available memory (MB): 32566
  Available CPU cores: 16
Binaries:
  Node: 20.12.2
  npm: N/A
  Yarn: N/A
  pnpm: 9.10.0
Relevant Packages:
  next: 14.2.10 // An outdated version detected (latest is 15.0.1), upgrade is highly recommended!
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.4
Next.js Config:
  output: standalone

Which example does this report relate to?

with-docker

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

Currently example Dockerfile does not try to copy .npmrc / .yarnrc files which can lead to issues when installing packages

Expected Behavior

Example Dockerfile should attempt to copy those configuration files just like it attempts to copy the lock files

To Reproduce

  1. Add a package from a private registry to your NextJS project
  2. Copy the example Dockerfile into your project
  3. Attempt to build the docker image
holgerflick commented 2 days ago

The example Dockerfile also fails when using pnpm. Even though the Lockfile exists, it stops creation at 4/4 with an npm error message which is strange as it should call pnpm.