fix(docker): ship Dashboard Docs markdown in the container image (#2348)

`.dockerignore` excluded everything under `docs/` except `openapi.yaml`,
which broke the in-product Docs viewer at `/docs/*` with "ENOENT: no
such file or directory, open '/app/docs/SETUP_GUIDE.md'" for every help
page. The previous block-list was meant to keep the image small but it
hid the ~5 MB English markdown tree that the viewer actually reads.

Replace the block with a targeted exclude of the heavy assets that
account for ~45 MB of the original ~50 MB:
- docs/i18n/** (translated copies — viewer falls back to English)
- docs/screenshots/**
- docs/diagrams/exported/** plus raster/SVG variants

Note: Go filepath.Match (Docker's matcher) treats `*` as not crossing
`/`, so the existing `*.md` rule still excludes only root-level
markdown — nested `docs/**/*.md` is implicitly kept without a
re-include rule that would have brought i18n back.

Added a regression test that parses .dockerignore and asserts the
critical English docs survive the filter while the heavy paths still
do not.
This commit is contained in:
diegosouzapw
2026-05-18 09:09:45 -03:00
parent 5da9b1b778
commit 2af324f6ee
2 changed files with 173 additions and 4 deletions

View File

@@ -37,10 +37,26 @@ test-results
playwright-report
blob-report
# Documentation (not needed in container)
# Keep the docs directory itself in context so openapi.yaml can be re-included.
docs/*
!docs/openapi.yaml
# Documentation
# Issue #2348: The Dashboard Docs viewer reads markdown from `/app/docs` at
# runtime. The previous `docs/*` block hid every file except openapi.yaml,
# so the in-product help screen failed with ENOENT for every page.
# We now keep the English markdown tree but drop the bulky assets
# (translations, screenshots, raster diagrams) that account for ~45 MB
# of the ~50 MB docs directory. The Docs viewer reads the default-locale
# (English) sources at runtime, so translations are not required in the
# container image.
docs/i18n/**
docs/screenshots/**
docs/diagrams/exported/**
docs/diagrams/**/*.png
docs/diagrams/**/*.jpg
docs/diagrams/**/*.jpeg
docs/diagrams/**/*.gif
docs/diagrams/**/*.webp
docs/diagrams/**/*.svg
# Note: `*.md` matches the root only (Go filepath.Match does not cross /),
# so nested docs/**/*.md is implicitly kept without a re-include rule.
*.md
!README.md