Skip to content

Commit b0bf712

Browse files
committed
dockerfile
1 parent 44aea2c commit b0bf712

File tree

3 files changed

+50
-1
lines changed

3 files changed

+50
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ docs/*
1313
!docs/README.md
1414
!docs/types.md
1515
!docs/sprite.md
16-
!docs/deprecations.md
16+
!docs/deprecations.md
17+
!docs/Dockerfile
18+
!docs/docker-compose.yml

docs/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Dockerfile for running MapLibre Style Spec documentation locally
2+
# Usage (from repo root):
3+
# docker build -f docs/Dockerfile -t maplibre-style-spec-docs .
4+
# docker run -p 8000:8000 maplibre-style-spec-docs
5+
6+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
7+
8+
# Install Node.js 22
9+
RUN apt-get update && apt-get install -y \
10+
curl \
11+
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
12+
&& apt-get install -y nodejs \
13+
&& rm -rf /var/lib/apt/lists/*
14+
15+
WORKDIR /app
16+
17+
# Copy everything (need source files for npm prepare script)
18+
COPY . .
19+
20+
# Install npm dependencies (with --ignore-scripts to avoid prepare, then run it manually)
21+
RUN npm ci --ignore-scripts \
22+
&& npm run generate-style-spec \
23+
&& npm run generate-docs
24+
25+
# Expose the default MkDocs port
26+
EXPOSE 8000
27+
28+
# Run the docs server
29+
CMD ["uvx", "zensical", "serve", "--dev-addr", "0.0.0.0:8000"]

docs/docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Docker Compose for running MapLibre Style Spec documentation
2+
# Usage (from repo root):
3+
# docker compose -f docs/docker-compose.yml up --build
4+
#
5+
# For development with live reload (watches local files):
6+
# docker compose -f docs/docker-compose.yml up
7+
8+
services:
9+
docs:
10+
build:
11+
context: ..
12+
dockerfile: docs/Dockerfile
13+
ports:
14+
- "8000:8000"
15+
volumes:
16+
# Mount docs and mkdocs config for live reload
17+
- ../docs:/app/docs:ro
18+
- ../mkdocs.yml:/app/mkdocs.yml:ro

0 commit comments

Comments
 (0)