-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
67 lines (57 loc) · 2.07 KB
/
Copy pathDockerfile
File metadata and controls
67 lines (57 loc) · 2.07 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM golang:1.26-alpine AS builder
ARG VERSION=dev
ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X main.version=${VERSION}" -o /document-mcp ./cmd/cli/
FROM debian:bookworm-slim
ARG TARGETARCH
ARG CHROME_VERSION=138.0.7204.183
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources \
&& apt-get update && apt-get install -y --no-install-recommends \
pandoc \
libreoffice-writer \
poppler-utils \
python3 \
python3-pip \
fonts-wqy-zenhei \
libpango-1.0-0 \
libpangocairo-1.0-0 \
libgdk-pixbuf-2.0-0 \
curl \
unzip \
ca-certificates \
tini \
&& if [ "$TARGETARCH" = "amd64" ]; then \
apt-get install -y --no-install-recommends \
libasound2 \
libatk-bridge2.0-0 \
libcups2 \
libdbus-1-3 \
libdrm2 \
libgbm1 \
libnss3 \
libxcomposite1 \
libxdamage1 \
libxext6 \
libxfixes3 \
libxkbcommon0 \
libxrandr2; \
curl -fsSL -o /tmp/headless-shell.zip "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROME_VERSION}/linux64/chrome-headless-shell-linux64.zip" \
&& unzip -q /tmp/headless-shell.zip -d /tmp/headless-shell \
&& mv /tmp/headless-shell/chrome-headless-shell-linux64/chrome-headless-shell /usr/local/bin/ \
&& chmod +x /usr/local/bin/chrome-headless-shell \
&& rm -rf /tmp/headless-shell /tmp/headless-shell.zip; \
fi \
&& pip3 install --break-system-packages --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ \
"markitdown[docx,pdf,pptx]==0.1.5" \
weasyprint \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /document-mcp /usr/local/bin/document-mcp
COPY themes/ /usr/local/share/document-mcp/themes/
WORKDIR /data
VOLUME ["/data"]
EXPOSE 8080
ENTRYPOINT ["/usr/bin/tini", "--", "document-mcp"]