Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions content/trento-docs-site/preview-docs-with-docker.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
== Local Documentation Preview with Docker

Easy way to locally preview documentation changes without installing repository dependencies (like Node.js or Antora) on your host machine.

=== Prerequisites

* Docker Engine (or Podman).
* Docker Compose.

=== Workflow

. **Start the Preview**
+
To start the build process inside a container, navigate to the root directory of the repository and run the following command:
+
[source,bash]
----
docker compose up
----
+

. **Check the Docs**
+
Once the build is complete and the server starts, open your browser and navigate to:
+
http://localhost:3000

. **Review and Rebuild**
+
The container builds the site and serves it. To view new changes:
+
* Stop the container (press `Ctrl+C`).
* Make your changes to the source files.
* Run `docker compose up` again.
+
The container will rebuild the documentation with your new changes for preview.
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
trento-docs:
image: node:20-bullseye
volumes:
- .:/workspace:z
Copy link
Member Author

Choose a reason for hiding this comment

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

Added :z for selinux enforcing issues

- trento-docs-node_modules:/workspace/trento-docs-site/node_modules
working_dir: /workspace/trento-docs-site
command: >
bash -lc "
npm install --no-save antora http-server &&
npx antora antora-playbook.yml &&
npx http-server build/trento-docs-site-public/ -c-1 -p 3000
"
ports:
- "3000:3000"

volumes:
trento-docs-node_modules:
1 change: 1 addition & 0 deletions trento-docs-site/modules/developer/nav_developer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

** Trento Documentation Page
*** xref:trento-docs-site/README.adoc[Documentation Page]
*** xref:trento-docs-site/preview-docs-with-docker.adoc[Local Documentation Preview with Docker]
*** xref:trento-docs-site/contribution-upstream/components-nav-guide.adoc[Component Documentation Navigation Guide]
*** xref:trento-docs-site/collaboration-docs-team/docs-git-workflow.adoc[Git Workflow for Trento Documentation]
*** xref:trento-docs-site-ui/README.adoc[Documentation Page UI]
Expand Down