# 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 . 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"]