8000 fix(docker): keep the host's node_modules, .next and .env out of the web app image by adeelahmad · Pull Request #55 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

fix(docker): keep the host's node_modules, .next and .env out of the web app image - #55

Merged
adeelahmad merged 1 commit into
mainfrom
claude/e2e-fixes-elucss
Oct 2, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/e2e-fixes-elucss

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Description

Before: building the web app image after a native pnpm install copied the host's node_modules into it with COPY . .. These were macOS binaries over the image's Linux ones, plus whatever openapi-ts version the host had. In the dev stack the older openapi-ts (0.83) rewrote the generated client on every start and left the git tree dirty. .env.local secrets and .next caches went into the image as well.

After: nextjs-frontend/.dockerignore keeps node_modules, .next, coverage, .env* (except .env.example), tsbuildinfo and shared-data out of the build context, for both Dockerfile and Dockerfile.prod.

Motivation and Context

Found while testing main end to end with both docker stacks.

Steps to reproduce (if appropriate):

Run pnpm install in nextjs-frontend/, then make dev, and git status shows the regenerated client. With this change the prod build context dropped to 5.35 MB with the host's node_modules present. The rebuilt image serves /login (200).

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ja26f8Npk3M6ixFhE1WEfe


Generated by Claude Code

…web app image

nextjs-frontend had no .dockerignore, so COPY . . brought in whatever a
native pnpm install or pnpm dev left behind: node_modules built for the
host (macOS binaries on a Mac, or packages from before a lockfile
change, which then regenerated an older API client in make dev), .next
caches and .env.local with AUTH_SECRET.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ja26f8Npk3M6ixFhE1WEfe
@adeelahmad
adeelahmad merged commit 3fa3998 into main Oct 2, 2026
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0