Skip to content

Commit 7dad72b

Browse files
authored
Fix local docs setup (#364)
1 parent 23f22dc commit 7dad72b

File tree

4 files changed

+28
-8
lines changed

4 files changed

+28
-8
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ lint-config: golangci-lint ## Verify golangci-lint linter configuration
125125
.PHONY: startdocs
126126
startdocs: ## Start the local mkdocs based development environment.
127127
docker build -t $(IMAGE) -f docs/Dockerfile . --load
128-
docker run -p 5173:5173 -v `pwd`/:/app $(IMAGE)
128+
docker run --rm -p 5173:5173 -v `pwd`/:/app $(IMAGE)
129129

130130
.PHONY: cleandocs
131131
cleandocs: ## Remove all local mkdocs Docker images (cleanup).

docs/Dockerfile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,8 @@ RUN apk add --no-cache bash
66
# Set working directory
77
WORKDIR /app
88

9-
# Install vitepress globally (optional, npx will work too)
10-
RUN npm install -g vitepress
11-
RUN npm install -g vitepress-plugin-mermaid
12-
139
# Expose dev port
1410
EXPOSE 5173
1511

1612
# Default command to start VitePress dev
17-
CMD ["npx", "vitepress", "dev", "docs", "--host", "0.0.0.0"]
13+
ENTRYPOINT ["./hack/start-docs.sh"]

docs/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ layout: home
44

55
hero:
66
name: "Metal Operator"
7-
text: "Kubernetes operator to automate bare metal servers"
8-
tagline: "Automate your bare metal servers with Kubernetes native API"
7+
text: "Kubernetes operator to automate Bare Metal Servers"
8+
tagline: "Automate your Bare Metal Servers with Kubernetes native API"
99
image:
1010
src: https://raw.githubusercontent.com/ironcore-dev/ironcore/refs/heads/main/docs/assets/logo_borderless.svg
1111
alt: VitePress

hack/start-docs.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env bash
2+
3+
# Install dependencies
4+
npm ci
5+
6+
# Run VitePress dev server
7+
npx vitepress dev docs --host 0.0.0.0 &
8+
9+
# Store the PID of the VitePress process
10+
VITEPRESS_PID=$!
11+
12+
# Function to handle SIGINT (Ctrl+C)
13+
handle_sigint() {
14+
echo "Stopping VitePress dev server..."
15+
kill -TERM "$VITEPRESS_PID"
16+
wait "$VITEPRESS_PID"
17+
exit 0
18+
}
19+
20+
# Trap SIGINT and call the handle_sigint function
21+
trap handle_sigint SIGINT
22+
23+
# Wait for the VitePress process to finish
24+
wait "$VITEPRESS_PID"

0 commit comments

Comments
 (0)