Skip to content

Containerize docs site tooling for security and update documentation - #4942

Merged
ChrisTitusTech merged 5 commits into
ChrisTitusTech:mainfrom
seanh1995:docs-run-security
Aug 10, 2026
Merged

Containerize docs site tooling for security and update documentation#4942
ChrisTitusTech merged 5 commits into
ChrisTitusTech:mainfrom
seanh1995:docs-run-security

Conversation

@seanh1995

Copy link
Copy Markdown
Contributor

Type of Change

  • New feature
  • Bug fix
  • Documentation update
  • Refactor
  • UI/UX improvement

Description

This pull request introduces Docker-based containerization for the docs/ site and updates related documentation and project rules to require all npm-based tooling to run inside Docker, not on the host. This is a security-driven change to prevent supply-chain attacks and standardize the development environment. The most important changes are grouped below.

Docs site containerization and workflow changes:

  • Added docs/Dockerfile and docs/docker-compose.yml to containerize the docs site, ensuring all npm/pnpm/yarn commands are run inside Docker (winutil-astro service) instead of the host. [1] [2]
  • Updated .dockerignore to exclude build artifacts, environment files, and logs from the Docker build context for cleaner, safer images.
  • Updated docs/README.md to document the new Docker-based workflow, removing old npm instructions and explaining the security rationale and command usage. [1] [2]

Repository rules and documentation updates:

  • Revised AGENTS.md to require all dependency installs, builds, and dev server runs for docs/ to use Docker, never direct npm/pnpm/yarn on the host; clarified the process and rationale. Section numbers and related instructions were updated throughout. [1] [2] [3] [4] [5] [6] [7]
  • Updated SPEC.md to reference the new Docker requirement for the docs site and point agents to the relevant section in AGENTS.md.

These changes improve security, consistency, and clarity for all contributors working on the documentation site.

Issue related to PR

  • Resolves #

Run Astro/Starlight dev, build, and preview commands through Docker
(docs/Dockerfile, docker-compose.yml, service winutil-astro) instead
of bare npm on the host, and document the required commands and
rationale in docs/README.md.
Add a Dependency Installs, Builds, And Dev Servers section to
AGENTS.md requiring docs/ tooling to run through Docker rather than
directly on the host, point SPEC.md's Docs Site section at the new
Dockerfile/docker-compose.yml, and renumber the remaining AGENTS.md
sections to stay sequential.
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Aug 7, 2026
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 97e94aa2-b461-49a2-baab-68d5854650cf

📥 Commits

Reviewing files that changed from the base of the PR and between a3be755 and e228598.

📒 Files selected for processing (1)
  • docs/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/README.md

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added Docker-based development support for the documentation site.
    • Added containerized workflows for installing dependencies, running the development server, and creating production builds.
    • Added Docker Compose support with source-code, dependency, and temporary-file management.
    • Added safeguards to exclude dependencies, build artifacts, environment files, and logs from container builds.
  • Documentation

    • Updated project documentation with Docker prerequisites, commands, project structure, and first-run guidance.
    • Documented the documentation site's containerization setup and development workflow.

Walkthrough

The PR adds Docker and Docker Compose support for the Astro documentation site. It updates documentation, project specifications, and agent instructions with containerized development and build workflows.

Changes

Documentation Docker tooling

Layer / File(s) Summary
Container runtime configuration
docs/.dockerignore, docs/Dockerfile, docs/docker-compose.yml
Adds Docker ignore rules, a Node 22 development image, and the winutil-astro Compose service with source, dependency, and temporary filesystem mounts.
Documentation workflow
SPEC.md, docs/README.md
Documents Docker files, prerequisites, Compose commands, dependency handling, rebuild conditions, and startup behavior.
Agent guidance
AGENTS.md
Requires documentation npm tooling to run inside Docker and renumbers the remaining guidance sections.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Developer
  participant DockerCompose
  participant Dockerfile
  participant AstroDevServer
  Developer->>DockerCompose: Start the documented Compose workflow
  DockerCompose->>Dockerfile: Build the docs image
  Dockerfile->>AstroDevServer: Install dependencies and start Astro
  DockerCompose->>AstroDevServer: Mount source and expose port 4321
  AstroDevServer-->>Developer: Serve the documentation site
Loading

Possibly related PRs

Suggested labels: new feature

Suggested reviewers: christitustech

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main changes: containerizing the docs site tooling and updating documentation.
Description check ✅ Passed The description directly explains the Docker containerization, security rationale, workflow changes, and documentation updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot added the new feature New feature or request label Aug 7, 2026
@seanh1995 seanh1995 changed the title Containerize docs site tooling and update documentation Containerize docs site tooling for security and update documentation Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/docker-compose.yml`:
- Line 8: Update the Docker Compose setup around the astro_node_modules volume
to ensure dependencies are refreshed when docs/package.json or
docs/package-lock.json changes. Add an appropriate dependency-volume sync step,
or document the required volume recreation workflow, while preserving the
existing /app/node_modules mount.
- Line 7: Update the docs compose bind mount around the service volume
configuration to avoid exposing the entire host docs directory, especially .env*
files, to package scripts. Mount only the required source and manifest paths
with appropriate read-only access for non-writable content, or revise the README
security claim to accurately reflect any remaining writable access.
- Line 5: Update the Docker Compose port mapping from "4321:4321" to
"127.0.0.1:4321:4321" so the service is published only on the host loopback
interface.

In `@docs/Dockerfile`:
- Around line 1-13: Update docs/Dockerfile to run the development command as the
non-root node user by adding USER node after ensuring /app and /app/node_modules
are owned by that user. Preserve the existing in-container npm install and
volume-mounted application workflow.

In `@docs/README.md`:
- Line 9: Label the fenced code block in the README with a text-compatible
language identifier, such as text or plaintext, so the markdownlint MD040 check
passes.
- Line 45: Update the documented winutil-astro preview command to include docker
compose run’s --service-ports option and pass --host 0.0.0.0 to the npm preview
script, ensuring the preview is reachable from outside the container.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cfa5d9fd-65fb-4fca-bf97-b5004dc18f9b

📥 Commits

Reviewing files that changed from the base of the PR and between 8d3adb5 and 63b21d0.

📒 Files selected for processing (6)
  • AGENTS.md
  • SPEC.md
  • docs/.dockerignore
  • docs/Dockerfile
  • docs/README.md
  • docs/docker-compose.yml

Comment thread docs/docker-compose.yml Outdated
Comment thread docs/docker-compose.yml
Comment thread docs/docker-compose.yml
Comment thread docs/Dockerfile
Comment thread docs/README.md
Comment thread docs/README.md Outdated
Tightened docs-container safety and clarified contributor workflow. The docs Docker image now switches to the non-root `node` user after setting ownership, and compose now binds Astro to `127.0.0.1` instead of all interfaces. Updated AGENTS and docs README instructions to explain the security boundary of the bind mount and to require rebuilding plus `docker compose down -v` after dependency changes so `node_modules` is reseeded correctly.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
AGENTS.md (1)

61-61: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low value

Update docs/package-lock.json when changing dependencies.

docs/Dockerfile runs npm install, and docs/docker-compose.yml bind-mounts the source into /app. If that install modifies node_modules, npm install can produce a new package-lock.json, but the guide currently only mentions docs/package.json. Require agents to update docs/package-lock.json, then rebuild the image and recreate the volume.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@AGENTS.md` at line 61, Update the dependency guidance in AGENTS.md to require
synchronizing docs/package-lock.json whenever docs/package.json changes, then
retain the instructions to rebuild the winutil-astro image and recreate the
node_modules volume so dependencies are installed from the updated lockfile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@AGENTS.md`:
- Line 64: Update the secret-handling guidance in AGENTS.md: instruct users to
keep real secrets outside docs/ and not rely on docs/.dockerignore as a runtime
boundary. Specify that only the required secret should be explicitly mounted
into the container at runtime.

---

Nitpick comments:
In `@AGENTS.md`:
- Line 61: Update the dependency guidance in AGENTS.md to require synchronizing
docs/package-lock.json whenever docs/package.json changes, then retain the
instructions to rebuild the winutil-astro image and recreate the node_modules
volume so dependencies are installed from the updated lockfile.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 20f9ab8b-c9d7-42ea-9e7e-2aa8650f5865

📥 Commits

Reviewing files that changed from the base of the PR and between 63b21d0 and a9adbc5.

📒 Files selected for processing (4)
  • AGENTS.md
  • docs/Dockerfile
  • docs/README.md
  • docs/docker-compose.yml
🚧 Files skipped from review as they are similar to previous changes (3)
  • docs/Dockerfile
  • docs/README.md
  • docs/docker-compose.yml

Comment thread AGENTS.md Outdated
Updates AGENTS.md to tighten docs security guidance: secrets must not be stored anywhere under `docs/`, because `docs/.dockerignore` only affects image build context and does not protect files from the Docker Compose bind mount used for docs dev/build commands.
The previous preview command didn't expose the port outside the container. Adding --service-ports and binding to 0.0.0.0 makes the preview server accessible from the host.
@ChrisTitusTech

Copy link
Copy Markdown
Owner

Looks good, my first reaction was oh no... he's gonna blow up my github workflows again, then I saw it was isolated into the docs folder and was like cool! haha.

@ChrisTitusTech
ChrisTitusTech merged commit 1458327 into ChrisTitusTech:main Aug 10, 2026
4 checks passed
@seanh1995
seanh1995 deleted the docs-run-security branch August 10, 2026 03:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation new feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants