mirror of
https://github.com/langgenius/dify.git
synced 2026-05-21 01:07:03 +08:00
- Replace Makefile with package.json scripts (ci, clean, docker:build-dev, sync-models, version:info); update cli-tests.yml to use pnpm ci - Add cli/Dockerfile.dev: multi-stage local build from monorepo source, proper cache layer order, non-root user, corepack-driven pnpm version - Add .dockerignore at repo root to exclude node_modules/dist/.git from build context - Add cli-docker-build.yml: PR + merge_group validation of Dockerfile.dev, amd64+arm64 via Depot for org; amd64-only for forks - cli-release.yml: pin action SHAs, depot-ubuntu-24.04 runner, move verify-release step before build for fast-fail - main-ci.yml: add packages/tsconfig/** and cli-docker-build.yml to cli path filter - Drop cli/docs/specs/** and cli/docs/*.md (superseded)
42 lines
1.0 KiB
Docker
42 lines
1.0 KiB
Docker
# difyctl local-build image — builds from source, no published npm package required.
|
|
# Use this for pre-release CI testing or local dev images.
|
|
# For release images use cli/Dockerfile (installs from npm registry).
|
|
#
|
|
# Build from repo root:
|
|
# docker build -f cli/Dockerfile.dev -t <image_name> .
|
|
|
|
FROM node:22-alpine AS builder
|
|
|
|
RUN corepack enable
|
|
|
|
WORKDIR /repo
|
|
|
|
# Copy manifests
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
|
COPY packages/tsconfig/package.json packages/tsconfig/
|
|
COPY cli/package.json cli/
|
|
|
|
RUN corepack install && pnpm install --frozen-lockfile --filter "@langgenius/difyctl..."
|
|
|
|
COPY packages/tsconfig/ packages/tsconfig/
|
|
COPY cli/ cli/
|
|
|
|
WORKDIR /repo/cli
|
|
RUN pnpm build && npm pack
|
|
|
|
|
|
FROM node:22-alpine
|
|
|
|
RUN addgroup -S difyctl && adduser -S -G difyctl difyctl
|
|
|
|
COPY --from=builder /repo/cli/langgenius-difyctl-*.tgz /tmp/
|
|
|
|
RUN npm install -g --no-fund --no-audit /tmp/langgenius-difyctl-*.tgz \
|
|
&& rm /tmp/*.tgz \
|
|
&& npm cache clean --force
|
|
|
|
USER difyctl
|
|
|
|
ENTRYPOINT ["difyctl"]
|
|
CMD ["--help"]
|