next.js
d85e2ae0 - Add .npmrc file to Dockerfile for custom npm configurations (#72064)

Commit
1 year ago
Add .npmrc file to Dockerfile for custom npm configurations (#72064) ### Description: This PR updates the Dockerfile in the `examples/with-docker` folder to include the `.npmrc` file in the dependency copy command. ### Original Command: ```dockerfile # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ ``` ### Updated Command: ```dockerfile # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./ ``` ### Reason for Change: Including `.npmrc` allows for custom npm configurations, such as `legacy-peer-deps=true`. Without this option, some installations can fail due to unresolved peer dependencies, particularly for projects with older dependencies. This update ensures that any additional configurations specified in `.npmrc` are applied during installation, improving Docker build consistency and stability for projects with custom npm requirements. ### Diff: ```diff - COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ + COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./ ``` --------- Co-authored-by: JJ Kasper <jj@jjsweb.site>
Author
Parents
Loading