-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
48 lines (38 loc) · 1.39 KB
/
Copy pathDockerfile
File metadata and controls
48 lines (38 loc) · 1.39 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
47
48
# Dockerfile for unslop CLI.
#
# Build:
# docker build -t unslop .
#
# Run (deterministic, reads from stdin):
# cat doc.md | docker run --rm -i unslop --stdin --deterministic
#
# Run (LLM mode with Anthropic API key, file mounted in):
# docker run --rm -it \
# -v "$PWD":/work -w /work \
# -e ANTHROPIC_API_KEY \
# unslop docs/README.md
#
# The image is intentionally minimal: no Anthropic SDK preinstalled. Pass
# --build-arg INSTALL_LLM=1 to include it if you plan to use LLM mode inside
# the container.
ARG PYTHON_VERSION=3.14
FROM python:${PYTHON_VERSION}-slim AS builder
WORKDIR /src
COPY unslop/ ./unslop/
ARG INSTALL_LLM=0
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir --prefix=/install ./unslop \
&& if [ "${INSTALL_LLM}" = "1" ]; then \
pip install --no-cache-dir --prefix=/install "./unslop[llm]"; \
fi
FROM python:${PYTHON_VERSION}-slim
LABEL org.opencontainers.image.title="unslop"
LABEL org.opencontainers.image.description="Strip AI-isms from markdown/text; preserve code, URLs, and headings."
LABEL org.opencontainers.image.source="https://github.com/MohamedAbdallah-14/unslop"
LABEL org.opencontainers.image.licenses="MIT"
RUN groupadd --system humanize && useradd --system --gid humanize --no-create-home humanize
USER humanize
WORKDIR /work
COPY --from=builder /install /usr/local
ENTRYPOINT ["unslop"]
CMD ["--help"]