Skip to content

Commit f367a10

Browse files
committed
Update
1 parent 4043168 commit f367a10

File tree

5 files changed

+8
-28
lines changed

5 files changed

+8
-28
lines changed

Dockerfile

Lines changed: 7 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,19 @@
11
# syntax=docker/dockerfile:1
2-
3-
# Stage 1: Install markdownlint-cli2
4-
FROM node:alpine AS linter-builder
5-
RUN npm install -g markdownlint-cli2
6-
7-
# Stage 2: Final Image
82
FROM python:3.12-alpine
93

4+
RUN apk add --no-cache bash git ca-certificates
105

11-
# 1. Install runtime essentials and Node.js (for linter)
12-
# git is needed for mkdocs-git plugins and git-auto-commit actions.
13-
# bash is needed for the entrypoint scripts.
14-
# ca-certificates is needed for HTTPS requests (pip, mkdocs etc).
15-
RUN apk add --no-cache \
16-
bash \
17-
git \
18-
nodejs \
19-
ca-certificates
6+
COPY --from=davidanson/markdownlint-cli2:latest /usr/local/bin/markdownlint-cli2 /usr/local/bin/markdownlint-cli2
207

21-
# 2. Copy markdownlint-cli2 from builder and create a slim shim
22-
COPY --from=linter-builder /usr/local/lib/node_modules/markdownlint-cli2 /usr/local/lib/node_modules/markdownlint-cli2
23-
RUN printf '#!/bin/sh\nnode /usr/local/lib/node_modules/markdownlint-cli2/markdownlint-cli2.js "$@"' > /usr/local/bin/markdownlint-cli2 && \
24-
chmod +x /usr/local/bin/markdownlint-cli2
25-
26-
# 3. Install Python dependencies and clean up cache in one layer
278
WORKDIR /app
9+
2810
COPY requirements.txt .
29-
RUN pip install --no-cache-dir -r requirements.txt
3011
COPY .markdownlint.json .
3112

32-
# 4. Copy scripts and build script
13+
RUN pip install --no-cache-dir -r requirements.txt
14+
3315
COPY scripts/ /app/scripts/
34-
COPY --chmod=755 mkdocs-build.sh /usr/local/bin/mkdocs-build
35-
COPY --chmod=755 mkdocs-serve.sh /usr/local/bin/mkdocs-serve
36-
COPY --chmod=755 zensical-serve.sh /usr/local/bin/zensical-serve
16+
COPY bin/ /usr/local/bin/
17+
RUN for f in /usr/local/bin/*.sh; do mv "$f" "${f%.sh}"; done && chmod +x /usr/local/bin/*
3718

38-
# Set default command
3919
CMD ["/usr/local/bin/mkdocs-build"]
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22
set -e
3-
markdownlint-cli2 "docs/**/*.md" --config "/app/.markdownlint.json" --fix > lint.log 2>&1 || true
3+
markdownlint-cli2 "docs/**/*.md" --config "/app/.markdownlint.json" --fix > lint.log 2>&1 || true
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)