feat(docker): migrate to Gitea registry-backed Docker pattern

- Convert all @bytelyst/* file: refs to semver ^0.1.0
- Remove sibling common-plat workspace references
- Add .npmrc and .npmrc.docker for local Gitea registry
- Rewrite Dockerfiles: pnpm + BuildKit secret mount
- Verified: pnpm install + backend typecheck pass
This commit is contained in:
saravanakumardb1 2026-03-23 20:57:37 -07:00
parent 1168da3ce2
commit bfbca2b820
8 changed files with 385 additions and 5814 deletions

3
.npmrc Normal file
View File

@ -0,0 +1,3 @@
@bytelyst:registry=http://localhost:3300/api/packages/bytelyst/npm/
//localhost:3300/api/packages/bytelyst/npm/:_authToken=${GITEA_NPM_TOKEN}
strict-ssl=false

3
.npmrc.docker Normal file
View File

@ -0,0 +1,3 @@
@bytelyst:registry=http://${GITEA_NPM_HOST}:3300/api/packages/bytelyst/npm/
//${GITEA_NPM_HOST}:3300/api/packages/bytelyst/npm/:_authToken=${GITEA_NPM_TOKEN}
strict-ssl=false

View File

@ -1,38 +1,42 @@
# Pre-requisite: run ./scripts/docker-prep.sh to pack @bytelyst/* tarballs
# ── Stage 1: Build ────────────────────────────────────
FROM node:22-slim AS builder
FROM node:22-alpine AS builder
WORKDIR /app/backend
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
RUN npm config set strict-ssl false
ARG GITEA_NPM_HOST
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,host.docker.internal,gateway.docker.internal,192.168.65.254,192.168.86.40
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
ENV GITEA_NPM_HOST=$GITEA_NPM_HOST
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 .npmrc.docker ./.npmrc
COPY backend/package.json ./package.json
COPY backend/.docker-deps/ ./.docker-deps/
RUN npm install
RUN --mount=type=secret,id=gitea_npm_token \
export GITEA_NPM_TOKEN="$(cat /run/secrets/gitea_npm_token)" && \
pnpm install --ignore-scripts --lockfile=false
COPY backend/tsconfig.json ./tsconfig.json
COPY backend/src/ ./src/
COPY shared/ ../shared/
RUN npm run build
RUN pnpm run build
# ── Stage 2: Prod deps ───────────────────────────────
FROM node:22-slim AS deps
WORKDIR /app/backend
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
RUN npm config set strict-ssl false
COPY backend/package.json ./package.json
COPY backend/.docker-deps/ ./.docker-deps/
RUN npm install --omit=dev
# ── Stage 3: Runtime ──────────────────────────────────
FROM node:22-slim
FROM node:22-alpine
WORKDIR /app/backend
ENV NODE_ENV=production
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,host.docker.internal,gateway.docker.internal,192.168.65.254,192.168.86.40
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
COPY --from=deps /app/backend/node_modules ./node_modules
COPY --from=deps /app/backend/package.json ./package.json
COPY --from=builder /app/backend/node_modules ./node_modules
COPY --from=builder /app/backend/package.json ./package.json
COPY --from=builder /app/backend/dist ./dist
COPY shared/product.json ../shared/product.json
COPY shared/ ../shared/
EXPOSE 4011
CMD ["node", "dist/server.js"]

View File

@ -14,17 +14,17 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@bytelyst/auth": "file:../../learning_ai_common_plat/packages/auth",
"@bytelyst/config": "file:../../learning_ai_common_plat/packages/config",
"@bytelyst/cosmos": "file:../../learning_ai_common_plat/packages/cosmos",
"@bytelyst/datastore": "file:../../learning_ai_common_plat/packages/datastore",
"@bytelyst/backend-config": "file:../../learning_ai_common_plat/packages/backend-config",
"@bytelyst/backend-flags": "file:../../learning_ai_common_plat/packages/backend-flags",
"@bytelyst/backend-telemetry": "file:../../learning_ai_common_plat/packages/backend-telemetry",
"@bytelyst/errors": "file:../../learning_ai_common_plat/packages/errors",
"@bytelyst/field-encrypt": "file:../../learning_ai_common_plat/packages/field-encrypt",
"@bytelyst/fastify-auth": "file:../../learning_ai_common_plat/packages/fastify-auth",
"@bytelyst/fastify-core": "file:../../learning_ai_common_plat/packages/fastify-core",
"@bytelyst/auth": "^0.1.0",
"@bytelyst/config": "^0.1.0",
"@bytelyst/cosmos": "^0.1.0",
"@bytelyst/datastore": "^0.1.0",
"@bytelyst/backend-config": "^0.1.0",
"@bytelyst/backend-flags": "^0.1.0",
"@bytelyst/backend-telemetry": "^0.1.0",
"@bytelyst/errors": "^0.1.0",
"@bytelyst/field-encrypt": "^0.1.0",
"@bytelyst/fastify-auth": "^0.1.0",
"@bytelyst/fastify-core": "^0.1.0",
"@azure/cosmos": "^4.2.0",
"fastify": "5.7.4",
"jose": "^6.0.8",

6058
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,3 @@
packages:
- backend
- web
- ../learning_ai_common_plat/packages/*

View File

@ -1,30 +1,46 @@
# Pre-requisite: run ./scripts/docker-prep.sh to pack @bytelyst/* tarballs
# ── Stage 1: Build ────────────────────────────────────
FROM node:22-slim AS builder
FROM node:22-alpine AS builder
WORKDIR /app/web
RUN npm config set strict-ssl false
COPY web/package.json ./package.json
COPY web/.docker-deps/ ./.docker-deps/
RUN npm install --legacy-peer-deps
ARG GITEA_NPM_HOST
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,host.docker.internal,gateway.docker.internal,192.168.65.254,192.168.86.40
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
ENV GITEA_NPM_HOST=$GITEA_NPM_HOST
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 .npmrc.docker ./.npmrc
COPY web/package.json ./package.json
RUN --mount=type=secret,id=gitea_npm_token \
export GITEA_NPM_TOKEN="$(cat /run/secrets/gitea_npm_token)" && \
pnpm install --ignore-scripts --lockfile=false
COPY web/next.config.ts ./next.config.ts
COPY web/tsconfig.json ./tsconfig.json
COPY web/next-env.d.ts ./next-env.d.ts
COPY web/src/ ./src/
COPY web/tsconfig.json web/next.config.ts web/postcss.config.mjs ./
COPY web/public/ ./public/
COPY shared/ ../shared/
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
RUN npm run build
RUN pnpm run build
# ── Stage 2: Runtime ──────────────────────────────────
FROM node:22-slim
WORKDIR /app
FROM node:22-alpine
WORKDIR /app/web
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
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,host.docker.internal,gateway.docker.internal,192.168.65.254,192.168.86.40
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
ENV NPM_CONFIG_STRICT_SSL=false
COPY --from=builder /app/web/.next/standalone ./
COPY --from=builder /app/web/.next/static ./.next/static
COPY --from=builder /app/web/public ./public
EXPOSE 3000
ENV PORT=3000
CMD ["node", "server.js"]

View File

@ -15,14 +15,14 @@
"test:e2e:ui": "playwright test --ui"
},
"dependencies": {
"@bytelyst/api-client": "file:../../learning_ai_common_plat/packages/api-client",
"@bytelyst/sync": "file:../../learning_ai_common_plat/packages/sync",
"@bytelyst/auth-client": "file:../../learning_ai_common_plat/packages/auth-client",
"@bytelyst/react-auth": "file:../../learning_ai_common_plat/packages/react-auth",
"@bytelyst/diagnostics-client": "file:../../learning_ai_common_plat/packages/diagnostics-client",
"@bytelyst/feature-flag-client": "file:../../learning_ai_common_plat/packages/feature-flag-client",
"@bytelyst/subscription-client": "file:../../learning_ai_common_plat/packages/subscription-client",
"@bytelyst/telemetry-client": "file:../../learning_ai_common_plat/packages/telemetry-client",
"@bytelyst/api-client": "^0.1.0",
"@bytelyst/sync": "^0.1.0",
"@bytelyst/auth-client": "^0.1.0",
"@bytelyst/react-auth": "^0.1.0",
"@bytelyst/diagnostics-client": "^0.1.0",
"@bytelyst/feature-flag-client": "^0.1.0",
"@bytelyst/subscription-client": "^0.1.0",
"@bytelyst/telemetry-client": "^0.1.0",
"@serwist/next": "^9.5.6",
"date-fns": "^4.1.0",
"idb": "^8.0.3",