Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

examples: Add .npmrc to Dockerfile to support custom npm configs #72132

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

AliReza99
Copy link
Contributor

Description:

This PR continues the work started in #72064 (already merged) by updating the Dockerfiles in the examples folder to include the .npmrc file in the dependency copy command.

Original Command:

# Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./

Updated Command:

# 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:

- COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
+ COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./

@ijjk ijjk added the examples Issue was opened via the examples template. label Oct 31, 2024
@ijjk
Copy link
Member

ijjk commented Oct 31, 2024

Allow CI Workflow Run

  • approve CI run for commit: a59b4cd

Note: this should only be enabled once the PR is ready to go and can only be enabled by a maintainer

Copy link
Member

@timneutkens timneutkens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ijjk ijjk merged commit 39c4cf9 into vercel:canary Nov 1, 2024
40 checks passed
@AliReza99 AliReza99 deleted the update-dockerfile branch November 2, 2024 05:54
stipsan pushed a commit to sanity-io/next.js that referenced this pull request Nov 6, 2024
…cel#72132)

### Description:
This PR continues the work started in
[vercel#72064](vercel#72064) (already merged)
by updating the Dockerfiles in the `examples` 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* ./
```
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2024
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
examples Issue was opened via the examples template. locked
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants