chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
60158935f4
commit
6519682885
15831 files changed
+3063428
No files matched your search
@@ -0,0 +1,85 @@
|
||||
# Go shellctl sandbox image — provides a sandboxed runtime environment
|
||||
# with common dev tools (Node.js, Python, pnpm, uv) for agent-managed jobs.
|
||||
#
|
||||
# Build:
|
||||
# docker build -f docker/Dockerfile -t dify-agent-local-sandbox:local .
|
||||
|
||||
# ── Go build stage ───────────────────────────────────────────────────────────
|
||||
FROM golang:1.26 AS go-builder
|
||||
|
||||
WORKDIR /src
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -o /bin/shellctl ./cmd/shellctl && \
|
||||
CGO_ENABLED=0 go build -o /bin/shellctl-sanitize-pty ./cmd/sanitize-pty && \
|
||||
CGO_ENABLED=0 go build -o /bin/shellctl-runner-exit ./cmd/runner-exit && \
|
||||
CGO_ENABLED=0 go build -o /bin/shellctl-runner ./cmd/runner && \
|
||||
CGO_ENABLED=0 go build -o /bin/dify-agent ./cmd/dify-agent-cli
|
||||
|
||||
# ── Runtime stage ────────────────────────────────────────────────────────────
|
||||
FROM python:3.13-slim-bookworm AS production
|
||||
|
||||
ARG NODE_VERSION=24.22.1
|
||||
ARG PNPM_VERSION=11.9.0
|
||||
ARG UV_VERSION=0.13.4
|
||||
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
bash \
|
||||
ca-certificates \
|
||||
curl \
|
||||
file \
|
||||
git \
|
||||
iproute2 \
|
||||
jq \
|
||||
less \
|
||||
openssh-client \
|
||||
procps \
|
||||
ripgrep \
|
||||
tini \
|
||||
tmux \
|
||||
unzip \
|
||||
xz-utils \
|
||||
zip \
|
||||
&& node_arch="$(dpkg --print-architecture)" \
|
||||
&& case "${node_arch}" in \
|
||||
amd64) node_arch="x64" ;; \
|
||||
arm64) node_arch="arm64" ;; \
|
||||
*) echo "Unsupported Node.js architecture: ${node_arch}" >&2; exit 1 ;; \
|
||||
esac \
|
||||
&& node_dist="node-v${NODE_VERSION}-linux-${node_arch}" \
|
||||
&& curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt" \
|
||||
&& curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/${node_dist}.tar.xz" \
|
||||
&& grep " ${node_dist}.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
|
||||
&& tar -xJf "${node_dist}.tar.xz" -C /usr/local --strip-components=1 \
|
||||
&& rm -f SHASUMS256.txt "${node_dist}.tar.xz" \
|
||||
&& npm install --global "pnpm@${PNPM_VERSION}" \
|
||||
&& npm cache clean --force \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN python -m pip install --no-cache-dir "uv==${UV_VERSION}"
|
||||
|
||||
# Go binaries
|
||||
COPY --from=go-builder /bin/shellctl /usr/local/bin/shellctl
|
||||
COPY --from=go-builder /bin/shellctl-sanitize-pty /usr/local/bin/shellctl-sanitize-pty
|
||||
COPY --from=go-builder /bin/shellctl-runner-exit /usr/local/bin/shellctl-runner-exit
|
||||
COPY --from=go-builder /bin/shellctl-runner /usr/local/bin/shellctl-runner
|
||||
COPY --from=go-builder /bin/dify-agent /usr/local/bin/dify-agent
|
||||
|
||||
RUN useradd --create-home --shell /bin/sh dify \
|
||||
&& mkdir -p /workspace \
|
||||
&& chown dify:dify /home \
|
||||
&& chown -R dify:dify /home/dify /workspace
|
||||
|
||||
USER dify
|
||||
WORKDIR /home/dify
|
||||
|
||||
EXPOSE 5004
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
|
||||
CMD ["shellctl", "serve", "--listen", "0.0.0.0:5004"]
|
||||
Reference in new issue
Block a user