Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Node.js Monorepo Dockerization
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[WORKSPACE_NAME] - ✦
[BASE_IMAGE] - ✦
[PRUNING_STRATEGY] - ✦
[INTERNAL_DEPS]
nodejs-monorepo-docker-optimization.txt
Act as a Full-Stack Architect. Generate a Dockerfile strategy for a Node.js monorepo (Turborepo or Nx). The prompt should handle the 'pruning' of [WORKSPACE_NAME] to ensure only relevant [INTERNAL_DEPS] are included in the build context. Use [BASE_IMAGE] as the foundation. Stage 1: Prune the workspace. Stage 2: Install and build. Stage 3: Runner stage copying only the necessary files for [WORKSPACE_NAME]. Include logic for symlink handling and global configuration files like .npmrc or .yarnrc.
Example Output
"A complex, multi-stage Dockerfile that selectively extracts a specific package from a monorepo, keeping the image size small despite a large shared codebase."