Toolboxes-Docs (vibe-kanban c5c3e68d)

TSYS Group Development Stack - Toolboxes - DocsAndDiagrams - Product Requirements Document -

## Docker Image Boilerplate

Image name: tsysdevstack-toolboxes-docs
Image username: tsysdevstack
Image base: latest Debian stable

- ALL operations MUST be as the tsysdevstack user
- NO ROOT ACCESS should be possible at runtime (no sudo, no su)
- The ONLY permitted use of root is during build time, and that MUST be to the ABSOLUTE MINIMUM extent possible (just for apt-get operations and creating the tsysdevstack user). Switching to tsysdevstack as early as possible.
- mise (as the tsysdevstack user) MUST be used to install all language runtimes (node/python/rust/ruby).
- If an application is installed via npm/pip/cargo/gem, those application installs MUST be done via mise managed versions of npm/pip/cargo/gem.
- NO system wide (apt-get) installs of language runtimes are allowed
- This is a production container. Use ALL best common practices for the building and securing of docker containers. (Buildx, multi stage, hardened )
- Use yamllint/hadolint/shellcheck (available via docker images on this system) as a QA gate BEFORE attempting to build the image. If ANY changes to Dockerfile/run.sh/build.sh/test.sh are made, run them through hadolint/shellcheck respectively.
- ALL hadolint/yamllint/shellcheck issues MUST be FULLY RESOLVED always. The only acceptable QA outcome is when those tools return no warnings/errors.
- Think about how to efficiently create the Dockerfile, keeping caching of layers in mind , especially how layers can be cached across multiple different image builds.
- Utilize buildkit/buildx
- This container needs to run on PC/Raspberry Pi/Mac M series.
- Reproducibility of the build is PARAMOUNT! Use version pinning for EVERYTHING. Do the research to find the latest stable version and update Dockerfile and other files accordingly. Do not "just use latest", that is never acceptable. You MUST pin the Debian package versions, and any of the tooling you install via mise managed runtimes.
- Use the examples subdirectory and create example artifacts and workflow scripts to fully QA the functionality of the container
- Create a README.md file that is BEAUTIFULLY formatted (using table of contents/headers/icons/graphics/whitespace/tables (with left justified text)). Document the container image thoroughly.
- Use the documentation subdirectory and creaate the following artifacts:
  - TROUBLESHOOTING.md
  - CHEATSHEET.md
  - USAGE.md
- Use the output subdirectory and create the following artifacts (ensure they will pass strict QA testing/auditing):

- Dockerfile
- docker-compose.yml
- devcontainer.json
- run.sh
- build.sh
- test.sh

## Docker Image Requirements

The overall purpose of this container image is to be a document production workhorse.

Core workflows:

- pandoc

 markdown to pdf/doc (for resumes) (so simple formatting, ATS optimized)
 markdown to pdf (for project plans, budgets, proposals etc)
 Joplin markdown notes to PDF preserving all the extensive formatting that Joplin has when it renders the notes to pdf

The generated PDFs need to be beautiful. Rich fonts, graphics, formatting of the code listings etc. We will be heavily leaning into texlive/xetex for this. I would also like to explore using wkhtmltopdf so that CSS can be used to style the output.

- mdbook
- typst
- marp
- markwhen
- kroki cli
- quarto
- bibtool
- vale

Add in any other common support tools you think may be needed (such as jq/yq).

Generally this image will be used "headless" to run a generation workflow (or mdbook serve during active development of an mdbook site).

It should have fish as it's shell (and also bash/zsh) for the occasional interactive use.

Follow test-driven-development for this project without fail.

Ensure that the image is built successfully and fully validated against this PRD

Use the /home/localuser/TSYSDevStack/Toolbox/docs/output directory for all of the work you do for this task.
This commit is contained in:
2025-11-11 20:59:13 -06:00
parent d94f81bc55
commit 544d1c31e5
18 changed files with 1902 additions and 0 deletions

101
test.sh Executable file
View File

@@ -0,0 +1,101 @@
#!/usr/bin/env bash
# test.sh - Script to test the tsysdevstack-toolboxes-docs container
set -e
# Default values
IMAGE_NAME="tsysdevstack/toolboxes-docs"
TAG="latest"
CONTAINER_NAME="test-tsysdevstack-toolboxes-docs"
TEST_DIR="/tmp/test-tsysdevstack-toolboxes-docs"
# Function to print test results
print_result() {
if [ $? -eq 0 ]; then
echo "✅ PASS: $1"
else
echo "❌ FAIL: $1"
exit 1
fi
}
# Function to run a command in the container and check the result
run_test_command() {
local test_name="$1"
local command="$2"
echo "Running test: $test_name"
docker run --rm --name "$CONTAINER_NAME-$(date +%s)" "$IMAGE_NAME:$TAG" bash -c "$command"
print_result "$test_name"
}
# Function to test if a command exists in the container
test_command_exists() {
local test_name="$1"
local command="$2"
run_test_command "$test_name" "which $command"
}
# Function to test if a specific version of a tool is available
test_version_command() {
local test_name="$1"
local command="$2"
local expected_version="$3"
echo "Running version test: $test_name"
docker run --rm --name "$CONTAINER_NAME-$(date +%s)" "$IMAGE_NAME:$TAG" bash -c "$command" | grep "$expected_version" > /dev/null
print_result "$test_name"
}
# Main test execution
main() {
echo "Starting tests for $IMAGE_NAME:$TAG..."
# Test that core utilities exist
test_command_exists "Check if pandoc exists" "pandoc"
test_command_exists "Check if mdbook exists" "mdbook"
test_command_exists "Check if typst exists" "typst"
test_command_exists "Check if marp exists" "marp"
test_command_exists "Check if markwhen exists" "markwhen"
test_command_exists "Check if quarto exists" "quarto"
test_command_exists "Check if jq exists" "jq"
test_command_exists "Check if yq exists" "yq"
test_command_exists "Check if wkhtmltopdf exists" "wkhtmltopdf"
test_command_exists "Check if bibtool exists" "bibtool"
test_command_exists "Check if vale exists" "vale"
test_command_exists "Check if kroki exists" "kroki"
test_command_exists "Check if fish shell exists" "fish"
test_command_exists "Check if zsh exists" "zsh"
test_command_exists "Check if bash exists" "bash"
# Test that TeXLive is properly installed
test_command_exists "Check if xelatex exists" "xelatex"
test_command_exists "Check if pdflatex exists" "pdflatex"
# Test that Python and Node.js are managed by mise
run_test_command "Check if Python is available via mise" "python --version"
run_test_command "Check if Node.js is available via mise" "node --version"
# Test that we can run a simple pandoc command
run_test_command "Test basic pandoc functionality" "echo '# Test' | pandoc -f markdown -t html | grep '<h1>Test</h1>'"
# Test that we can run a simple mdbook command
run_test_command "Test basic mdbook functionality" "mdbook --version"
# Test that we can run a simple typst command
run_test_command "Test basic typst functionality" "echo '# Hello' > /tmp/test.typ && typst compile /tmp/test.typ /tmp/test.pdf && [ -f /tmp/test.pdf ]"
# Test that user is not root
run_test_command "Check that default user is not root" "whoami | grep tsysdevstack"
# Test that required directories exist
run_test_command "Check that output directory exists" "[ -d /home/tsysdevstack/TSYSDevStack/Toolbox/docs/output ]"
# Test that we can write to the output directory
run_test_command "Test write access to output directory" "touch /home/tsysdevstack/TSYSDevStack/Toolbox/docs/output/test_file.txt && [ -f /home/tsysdevstack/TSYSDevStack/Toolbox/docs/output/test_file.txt ]"
echo "All tests passed! 🎉"
}
main