Skip to content

perf: Optimize dev container startup using anonymous volume for node_modules#22

Open
KinshukSS2 wants to merge 1 commit intoistSOS:mainfrom
KinshukSS2:optimize-dev-docker-setup
Open

perf: Optimize dev container startup using anonymous volume for node_modules#22
KinshukSS2 wants to merge 1 commit intoistSOS:mainfrom
KinshukSS2:optimize-dev-docker-setup

Conversation

@KinshukSS2
Copy link
Copy Markdown

@KinshukSS2 KinshukSS2 commented Apr 12, 2026

Summary

this PR removes runtime dependency installation from dev container startup and replaces it with a persistent container-side dependency strategy.

What Changed

  • Updated docker-compose_dev.yml to run npm run dev directly.
  • Added anonymous volume mount for /home/node/app/node_modules.
  • Updated ui/Dockerfile.dev to install dependencies during image build using npm ci.
  • Updated README.md dev command references to match the compose file used by this change.

Why This Is Better

  • Eliminates repeated npm install on each startup.
  • Preserves hot-reload workflow through bind-mounted source code.
  • Prevents host mount from masking container dependencies.
  • Produces faster and more reliable restart cycles.

Validation

  • Ran:
docker compose -f docker-compose_dev.yml up --build -d
  • Verified container starts successfully and Next.js launches with npm run dev.
  • Verified no sh: next: not found error.
  • Restarted services and confirmed faster startup behavior without runtime install.

fixes #21

@KinshukSS2 KinshukSS2 force-pushed the optimize-dev-docker-setup branch from 205adca to 0f304ea Compare April 12, 2026 18:45
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.

Performance regression in dev container startup due to runtime dependency installation

1 participant