Skip to content
Merged
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,17 @@ The official Docker image for Doc Detective, a documentation testing framework t

## Features

- Pre-installed with Node.js and Doc Detective
- Pre-installed with
- Doc Detective
- Node.js
- Python 3
- Java Runtime Environment (JRE)
- DITA Open Toolkit (DITA-OT)
- Includes Google Chrome and Firefox for browser-based tests
- Includes DITA Open Toolkit (DITA-OT) for DITA content transformation
- Optimized for CI/CD pipelines and containerized environments
- Simple volume mounting for working with your local test files

> **Note:** This image runs Doc Detective in a headless mode and isn't compatible with the `record` step. If you need to record test runs, use the [Doc Detective CLI](https://github.com/doc-detective/doc-detective) directly in your local environment.
> **Note:** This image runs Doc Detective in a headless mode and isn't compatible with the `record` step. If you need to record test runs, use the [Doc Detective CLI](https://github.com/doc-detective/doc-detective) directly in your local or CI/CD environment.

## Usage

Expand Down
9 changes: 9 additions & 0 deletions linux.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ RUN apt update \
libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 \
libxtst6 ffmpeg wget xdg-utils \
default-jre \
python3 python3-pip python3-venv \
&& update-ca-certificates \
&& apt autoclean -y \
&& apt autoremove -y \
Expand All @@ -44,6 +45,14 @@ RUN curl -kL https://github.com/dita-ot/dita-ot/releases/download/${DITA_OT_VERS
# Add DITA-OT to PATH
ENV PATH="/opt/dita-ot/bin:${PATH}"

# Check versions of installed packages
RUN node -v \
&& npm -v \
&& java -version \
&& python3 --version \
&& pip3 --version \
&& dita --version

# Create app directory
WORKDIR /app

Expand Down
71 changes: 0 additions & 71 deletions test/ditaVersion.test.js

This file was deleted.

31 changes: 28 additions & 3 deletions windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM mcr.microsoft.com/windows/server:ltsc2022 AS system
ARG PACKAGE_VERSION=latest
ARG PYTHON_VERSION=3.13.1

LABEL authors="Doc Detective" \
description="The official Docker image for Doc Detective. Keep your docs accurate with ease." \
Expand Down Expand Up @@ -47,9 +48,29 @@ RUN $env:Path = 'C:\Program Files\nodejs;' + $env:Path; \
npm -v; \
npm install -g npm@latest

# Install Doc Detective from NPM
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \
npm install -g doc-detective@$env:PACKAGE_VERSION
# Download and install Python
RUN $PythonVersion = $env:PYTHON_VERSION; \
$PythonMajorMinor = ($PythonVersion -split '\.')[0..1] -join ''; \
$PythonUrl = 'https://www.python.org/ftp/python/' + $PythonVersion + '/python-' + $PythonVersion + '-amd64.exe'; \
$PythonInstaller = 'C:\python-installer.exe'; \
Write-Host 'Downloading Python...'; \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest -Uri $PythonUrl -OutFile $PythonInstaller -UseBasicParsing; \
Write-Host 'Installing Python...'; \
Start-Process -FilePath $PythonInstaller -ArgumentList '/quiet', 'InstallAllUsers=1', 'PrependPath=0', 'Include_test=0' -Wait; \
Write-Host 'Python installation completed'; \
Remove-Item -Path $PythonInstaller -Force

# Add Python to PATH and verify installation
RUN $PythonVersion = $env:PYTHON_VERSION; \
$PythonMajorMinor = ($PythonVersion -split '\.')[0..1] -join ''; \
$PythonPath = 'C:\Program Files\Python' + $PythonMajorMinor; \
$PythonScriptsPath = 'C:\Program Files\Python' + $PythonMajorMinor + '\Scripts'; \
$env:Path = $PythonPath + ';' + $PythonScriptsPath + ';' + $env:Path; \
[Environment]::SetEnvironmentVariable('Path', $env:Path, [System.EnvironmentVariableTarget]::Machine); \
Write-Host 'Verifying Python installation...'; \
python --version; \
pip --version;

# Download and install Microsoft OpenJDK 17
RUN $JavaVersion = '17.0.14'; \
Expand Down Expand Up @@ -93,6 +114,10 @@ RUN $env:Path = 'C:\dita-ot\bin;' + $env:Path; \
Write-Host 'DITA-OT installed. Verifying...'; \
dita --version

# Install Doc Detective from NPM
RUN Set-ExecutionPolicy Bypass -Scope Process -Force; \
npm install -g doc-detective@$env:PACKAGE_VERSION

# Create app directory
WORKDIR /app

Expand Down