Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (34 loc) · 1.94 KB
/
Copy pathDockerfile
File metadata and controls
46 lines (34 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# ── build stage ──────────────────────────────────────────────
FROM python:3.12-slim AS builder
WORKDIR /app
# Copy only what pip needs to install the package.
COPY pyproject.toml README.md CHANGELOG.md LICENSE ./
COPY llmwiki/ llmwiki/
# Install the package (and its sole runtime dep: markdown>=3.4).
RUN pip install --no-cache-dir .
# ── runtime stage ────────────────────────────────────────────
FROM python:3.12-slim
# OCI-standard labels — registries + security scanners use these.
LABEL org.opencontainers.image.title="llmwiki" \
org.opencontainers.image.description="Karpathy-style LLM wiki from Claude Code, Codex, Cursor, Gemini, Copilot, and Obsidian sessions" \
org.opencontainers.image.source="https://github.com/AlexanderMakarov/llm-wiki" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.authors="Alexander Makarov <4ellendger@gmail.com>"
# Non-root user for runtime safety. UID 1000 matches the default Linux
# host user so mounted volumes don't end up root-owned.
RUN groupadd --gid 1000 app && \
useradd --uid 1000 --gid app --shell /bin/bash --create-home app
# Bring over installed packages and the CLI entry-point script.
COPY --from=builder /usr/local/lib/python3.12/site-packages/ \
/usr/local/lib/python3.12/site-packages/
COPY --from=builder /usr/local/bin/llmwiki /usr/local/bin/llmwiki
WORKDIR /wiki
# Seed the example sessions so `llmwiki init` has something to demo.
COPY --chown=app:app examples/ examples/
# Fix ownership on the mount point so bind-mounts work as the app user.
RUN chown -R app:app /wiki
USER app
ENTRYPOINT ["llmwiki"]
# The site is plain files: build it into the bind-mounted site/ and open
# site/index.html on the host. The container hosts nothing.
CMD ["build"]