Files
xiaohongshu-mcp/Dockerfile
lmxdawn a8a2743a51 feat: 支持返回登录二维码与 Docker 部署 (#155)
* feat: 支持返回登录二维码与 Docker 部署

* feat: 完善扫码登录功能

* fix: 修复当存在已经登录的情况,上层还会启动 goroutine的问题,并把 mcp 的返回增加为图片格式
2025-09-25 19:44:01 +08:00

50 lines
974 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ---- build stage ----
FROM golang:1.24 AS builder
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o /out/app .
# ---- run stage ----
FROM debian:bookworm-slim
WORKDIR /app
# 1. 装 Chromium + 依赖(无头模式运行 rod
RUN apt-get update && \
apt-get install -y --no-install-recommends \
chromium \
ca-certificates \
fonts-liberation \
fonts-noto-cjk \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libcups2 \
libdrm2 \
libxkbcommon0 \
libxcomposite1 \
libxdamage1 \
libxfixes3 \
libxrandr2 \
libgbm1 \
libpango-1.0-0 \
libnss3 \
libxshmfence1 \
wget \
tzdata \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /out/app .
# 2. 设置默认 Chromium 路径rod 会用)
ENV ROD_BROWSER_BIN=/usr/bin/chromium
EXPOSE 18060
CMD ["./app"]