diff --git a/apps/docs/src/components/custom-widget-code.tsx b/apps/docs/src/components/custom-widget-code.tsx index 9c392d91c..394ffae79 100644 --- a/apps/docs/src/components/custom-widget-code.tsx +++ b/apps/docs/src/components/custom-widget-code.tsx @@ -1,7 +1,21 @@ import BrowserOnly from "@docusaurus/BrowserOnly"; import { useState } from "react"; import { MantineProvider, Select, Stack, Text } from "@mantine/core"; -import "@mantine/core/styles.css"; +/* oxlint-disable import/no-unassigned-import -- Mantine component styles intentionally load for side effects. */ +import "@mantine/core/styles/Badge.css"; +import "@mantine/core/styles/Button.css"; +import "@mantine/core/styles/Combobox.css"; +import "@mantine/core/styles/Group.css"; +import "@mantine/core/styles/Input.css"; +import "@mantine/core/styles/Loader.css"; +import "@mantine/core/styles/Pill.css"; +import "@mantine/core/styles/PillsInput.css"; +import "@mantine/core/styles/Popover.css"; +import "@mantine/core/styles/ScrollArea.css"; +import "@mantine/core/styles/Stack.css"; +import "@mantine/core/styles/Text.css"; +import "@mantine/core/styles/UnstyledButton.css"; +/* oxlint-enable import/no-unassigned-import */ import { BUNDLED_CUSTOM_WIDGETS, diff --git a/apps/workshop/README.md b/apps/workshop/README.md index 28a17d0ef..1c608e75a 100644 --- a/apps/workshop/README.md +++ b/apps/workshop/README.md @@ -26,4 +26,14 @@ Run the disposable service integration test from the repository root: pnpm test:workshop ``` +## Production docs preview + +Build the documentation and serve it from PocketBase using the same production image layout as the hosted Workshop: + +```sh +pnpm docker:docs +``` + +Open `http://127.0.0.1:3003`. Set `DOCS_EXPOSE_PORT` to use another host port. The preview container is removed when it stops and does not persist PocketBase data. + Production data lives in `/pb_data`. The image serves the built Homarr documentation and Workshop UI from `/pb_public`. diff --git a/apps/workshop/run-docs.sh b/apps/workshop/run-docs.sh new file mode 100755 index 000000000..26550bdfe --- /dev/null +++ b/apps/workshop/run-docs.sh @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu + +DOCS_IMAGE=${DOCS_IMAGE:-homarr/docs:local} +DOCS_EXPOSE_PORT=${DOCS_EXPOSE_PORT:-3003} + +docker build \ + --target production \ + --file apps/workshop/Dockerfile \ + --tag "$DOCS_IMAGE" \ + . + +exec docker run \ + --rm \ + --name homarr-docs \ + --publish "127.0.0.1:${DOCS_EXPOSE_PORT}:8090" \ + --env PB_ALLOWED_ORIGINS='*' \ + "$DOCS_IMAGE" diff --git a/package.json b/package.json index f646475f3..97a5ce52b 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "db:studio": "pnpm -F db studio", "dev": "pnpm -F nextjs dev", "dev:docs": "pnpm -F @homarr/docs dev", + "docker:docs": "sh apps/workshop/run-docs.sh", "docker:dev": "docker compose -f ./development/development.docker-compose.yml up", "format": "turbo format --continue -- --check", "format:fix": "turbo format --continue",