mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-03 06:12:14 +08:00
fix: add build-arg support for proxies and mirrors in Docker builds (#1346)
* fix: add build-arg support for proxies and mirrors in Docker builds (#1260) Pin Debian images to bookworm, make UV source image configurable, and pass APT_MIRROR/NPM_REGISTRY/UV_IMAGE through docker-compose. * fix: ensure build args use consistent defaults across compose and Dockerfiles UV_IMAGE: ${UV_IMAGE:-} resolved to empty when unset, overriding the Dockerfile ARG default and breaking `FROM ${UV_IMAGE}`. Also configure COREPACK_NPM_REGISTRY before pnpm download and propagate NPM_REGISTRY into the prod stage. * fix: dearmor NodeSource GPG key to resolve signing error Pipe the downloaded key through gpg --dearmor so apt can verify the repository signature (fixes NO_PUBKEY 2F59B5F99B1BE0B4). --------- Co-authored-by: JeffJiang <for-eleven@hotmail.com>
This commit is contained in:
@@ -8,8 +8,17 @@ ARG PNPM_STORE_PATH=/root/.local/share/pnpm/store
|
||||
# ── Base: shared setup ────────────────────────────────────────────────────────
|
||||
FROM node:22-alpine AS base
|
||||
ARG PNPM_STORE_PATH
|
||||
RUN corepack enable && corepack install -g pnpm@10.26.2
|
||||
ARG NPM_REGISTRY
|
||||
# Configure corepack registry before installing pnpm so the download itself
|
||||
# succeeds in restricted networks (COREPACK_NPM_REGISTRY controls where
|
||||
# corepack fetches package managers from).
|
||||
RUN if [ -n "${NPM_REGISTRY}" ]; then \
|
||||
export COREPACK_NPM_REGISTRY="${NPM_REGISTRY}"; \
|
||||
fi && \
|
||||
corepack enable && corepack install -g pnpm@10.26.2
|
||||
RUN pnpm config set store-dir ${PNPM_STORE_PATH}
|
||||
# Optionally override npm registry for restricted networks (e.g. NPM_REGISTRY=https://registry.npmmirror.com)
|
||||
RUN if [ -n "${NPM_REGISTRY}" ]; then pnpm config set registry "${NPM_REGISTRY}"; fi
|
||||
WORKDIR /app
|
||||
COPY frontend ./frontend
|
||||
|
||||
@@ -27,8 +36,13 @@ RUN cd /app/frontend && SKIP_ENV_VALIDATION=1 pnpm build
|
||||
# ── Prod: minimal runtime with pre-built output ───────────────────────────────
|
||||
FROM node:22-alpine AS prod
|
||||
ARG PNPM_STORE_PATH
|
||||
RUN corepack enable && corepack install -g pnpm@10.26.2
|
||||
ARG NPM_REGISTRY
|
||||
RUN if [ -n "${NPM_REGISTRY}" ]; then \
|
||||
export COREPACK_NPM_REGISTRY="${NPM_REGISTRY}"; \
|
||||
fi && \
|
||||
corepack enable && corepack install -g pnpm@10.26.2
|
||||
RUN pnpm config set store-dir ${PNPM_STORE_PATH}
|
||||
RUN if [ -n "${NPM_REGISTRY}" ]; then pnpm config set registry "${NPM_REGISTRY}"; fi
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/frontend ./frontend
|
||||
EXPOSE 3000
|
||||
|
||||
Reference in New Issue
Block a user