fix(docker): make proxy optional in dashboard Dockerfiles, strip proxy in VM setup

This commit is contained in:
saravanakumardb1 2026-03-24 10:35:00 -07:00
parent 3b31709b47
commit 2b9fd71740
3 changed files with 34 additions and 9 deletions

View File

@ -1,15 +1,17 @@
FROM node:20-alpine AS builder
FROM node:22-alpine AS builder
WORKDIR /app
ENV HTTP_PROXY=http://cso.proxy.att.com:8080/
ENV HTTPS_PROXY=http://cso.proxy.att.com:8080/
ENV NO_PROXY=localhost,127.0.0.1
ARG HTTP_PROXY=""
ARG HTTPS_PROXY=""
ARG NO_PROXY="localhost,127.0.0.1"
ENV HTTP_PROXY=${HTTP_PROXY}
ENV HTTPS_PROXY=${HTTPS_PROXY}
ENV NO_PROXY=${NO_PROXY}
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
ENV HUSKY=0
RUN npm config set strict-ssl false \
&& npm config set registry https://jfrog-pkg-proxy.it.att.com/artifactory/api/npm/att-npm-proxy-group/ \
&& npm install -g pnpm@10.6.5
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.base.json ./

View File

@ -1,15 +1,17 @@
FROM node:22-alpine AS builder
WORKDIR /app
ENV HTTP_PROXY=http://cso.proxy.att.com:8080/
ENV HTTPS_PROXY=http://cso.proxy.att.com:8080/
ENV NO_PROXY=localhost,127.0.0.1
ARG HTTP_PROXY=""
ARG HTTPS_PROXY=""
ARG NO_PROXY="localhost,127.0.0.1"
ENV HTTP_PROXY=${HTTP_PROXY}
ENV HTTPS_PROXY=${HTTPS_PROXY}
ENV NO_PROXY=${NO_PROXY}
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
ENV HUSKY=0
RUN npm config set strict-ssl false \
&& npm config set registry https://jfrog-pkg-proxy.it.att.com/artifactory/api/npm/att-npm-proxy-group/ \
&& npm install -g pnpm@10.6.5
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml tsconfig.base.json ./

View File

@ -249,6 +249,27 @@ phase3_clone() {
fi
done
# ── Strip corporate proxy from Dockerfiles ──────────────────────────
# Product Dockerfiles have hardcoded AT&T corporate proxy ENVs that
# would break builds on any non-corporate network (including Azure VMs).
# Strip them since we don't need a proxy on the VM.
log " Stripping corporate proxy from Dockerfiles..."
local patched=0
for df in "${INSTALL_DIR}"/*/backend/Dockerfile "${INSTALL_DIR}"/*/web/Dockerfile "${INSTALL_DIR}"/learning_multimodal_memory_agents/mindlyst-native/web/Dockerfile "${INSTALL_DIR}"/learning_voice_ai_agent/user-dashboard-web/Dockerfile; do
[ -f "$df" ] || continue
if grep -q 'cso\.proxy\.att\.com' "$df" 2>/dev/null; then
# Remove proxy ENV lines and jfrog registry reference
sed -i \
-e '/HTTP_PROXY=http:\/\/cso\.proxy/d' \
-e '/HTTPS_PROXY=http:\/\/cso\.proxy/d' \
-e '/NO_PROXY=/d' \
-e 's|npm config set registry https://jfrog-pkg-proxy[^ ]* && ||' \
"$df"
patched=$((patched + 1))
fi
done
ok " Patched ${patched} Dockerfiles (removed corporate proxy)."
ok "Phase 3 complete. All repos in ${INSTALL_DIR}/"
}