Skip to content

docs: add Docker bundling guide#603

Merged
cogwirrel merged 6 commits intomainfrom
docs/docker-bundling-guide
Apr 21, 2026
Merged

docs: add Docker bundling guide#603
cogwirrel merged 6 commits intomainfrom
docs/docker-bundling-guide

Conversation

@nx-plugin-for-aws
Copy link
Copy Markdown
Collaborator

Reason for this change

The ts#strands-agent and py#strands-agent generators tackle a few gotchas when bundling application code and deploying it as a Docker image to ECR. That pattern (a cached bundle target that produces a self-contained directory, a minimal Dockerfile that simply COPYs it, and a docker target that assembles the build context in dist) is generally useful outside of AgentCore — for example for FastAPI on ECS — but until now it was not documented.

Description of changes

  • Adds a new Best Practices section to the docs sidebar (above Troubleshooting), with locale labels for all supported languages.
  • Adds a Docker bundling page under that section (/guides/docker-bundling) describing the pattern with separate TypeScript and Python sections. The guide covers:
    • The bundle target (Rolldown for TypeScript, uv export + uv pip install for Python).
    • The minimal Dockerfile that COPYs the bundle, plus RUN npm install for TypeScript packages declared as external in rolldown.config.ts.
    • The docker target that copies the Dockerfile alongside the bundle output and runs docker build.
    • Wiring the resulting build-context directory to CDK's DockerImageAsset, or to an aws_ecr_repository + null_resource Terraform module that publishes to ECR.
  • No generator or code changes — this is a docs-only PR. Only the English source is updated; translations are generated.

Description of how you validated changes

  • Built the docs site (pnpm nx run docs:build) and confirmed the new page is emitted for all locales and that link validation passes.
  • Cross-referenced the described pattern against the current ts#strands-agent and py#strands-agent generators (packages/nx-plugin/src/ts/strands-agent/generator.ts, packages/nx-plugin/src/py/strands-agent/generator.ts, packages/nx-plugin/src/utils/bundle/bundle.ts, and the deploy Dockerfile templates) to confirm the commands and infrastructure snippets match what the generators produce today.

Issue # (if applicable)

Closes #328.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

nx-plugin-for-aws and others added 2 commits April 21, 2026 11:18
Introduces a "Best Practices" sidebar section and a new "Docker bundling"
page that describes the bundle target + minimal Dockerfile + docker
target pattern used by ts#strands-agent and py#strands-agent, and shows
how to wire the resulting build context to CDK's DockerImageAsset or a
Terraform null_resource publishing to ECR.

Closes #328
@github-actions
Copy link
Copy Markdown
Contributor

📚 Documentation translations have been updated and committed (9ea60a6) to this PR.

docs/src/content/docs/es/guides/docker-bundling.mdx
docs/src/content/docs/fr/guides/docker-bundling.mdx
docs/src/content/docs/it/guides/docker-bundling.mdx
docs/src/content/docs/jp/guides/docker-bundling.mdx
docs/src/content/docs/ko/guides/docker-bundling.mdx
docs/src/content/docs/pt/guides/docker-bundling.mdx
docs/src/content/docs/vi/guides/docker-bundling.mdx
docs/src/content/docs/zh/guides/docker-bundling.mdx

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.02%. Comparing base (00935a5) to head (d3da0b9).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #603   +/-   ##
=======================================
  Coverage   89.02%   89.02%           
=======================================
  Files         106      106           
  Lines        3443     3443           
  Branches      747      747           
=======================================
  Hits         3065     3065           
  Misses        174      174           
  Partials      204      204           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
Comment thread docs/src/content/docs/en/guides/docker-bundling.mdx Outdated
nx-plugin-for-aws and others added 2 commits April 21, 2026 14:40
- Pin the ADOT npm version in the Dockerfile example and add a tip
  about pinning dependencies and base image tags for reproducible
  builds
- Move the RUN npm install step above COPY so the install layer is
  cached independently of the bundle output
- Note that docker build is optional when deploying with CDK
- Import findWorkspaceRoot from :my-scope/common-constructs and
  mention the alternative of hardcoding the workspace-relative path
- Drop the definite article in "Running bundle before synth/apply"
- Use nx apply in the Terraform note
- Merge the CDK and Terraform sections into a single top-level
  Infrastructure heading, since the wiring is identical across
  TypeScript and Python
- Mention "generator" explicitly in Further Reading links
@github-actions
Copy link
Copy Markdown
Contributor

📚 Documentation translations have been updated and committed (10da405) to this PR.

docs/src/content/docs/es/guides/docker-bundling.mdx
docs/src/content/docs/fr/guides/docker-bundling.mdx
docs/src/content/docs/it/guides/docker-bundling.mdx
docs/src/content/docs/jp/guides/docker-bundling.mdx
docs/src/content/docs/ko/guides/docker-bundling.mdx
docs/src/content/docs/pt/guides/docker-bundling.mdx
docs/src/content/docs/vi/guides/docker-bundling.mdx
docs/src/content/docs/zh/guides/docker-bundling.mdx

@github-actions
Copy link
Copy Markdown
Contributor

📚 Documentation translations have been updated and committed (d3da0b9) to this PR.

docs/src/content/docs/es/guides/docker-bundling.mdx
docs/src/content/docs/fr/guides/docker-bundling.mdx
docs/src/content/docs/it/guides/docker-bundling.mdx
docs/src/content/docs/jp/guides/docker-bundling.mdx
docs/src/content/docs/ko/guides/docker-bundling.mdx
docs/src/content/docs/pt/guides/docker-bundling.mdx
docs/src/content/docs/vi/guides/docker-bundling.mdx
docs/src/content/docs/zh/guides/docker-bundling.mdx

@cogwirrel cogwirrel merged commit ab81750 into main Apr 21, 2026
19 checks passed
@cogwirrel cogwirrel deleted the docs/docker-bundling-guide branch April 21, 2026 06:20
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.

Add docker/bundling guide for python/typescript

3 participants