- Add /trading and /admin named Socket.IO namespaces; root namespace kept for backward compat; admin namespace rejects non-admins at connect time - Wire auditRepository.ts: persist TradeAuditEvent to Cosmos audit-events container (best-effort); expose GET /api/admin/audit for admin queries - Add tradingTelemetry singleton (Node.js Map-based storage adapter); init and fatal-error tracking wired in index.ts main() - Add TAB_MARKETPLACE_ENABLED / TAB_MEMBERSHIP_ENABLED config flags; expose tabs.* shape in GET /api/feature-flags response - Fix SupabaseService URL validation (regex check before createClient) - Wire check:api-contract and check:audit-repository into npm run test - Switch @bytelyst/* deps to file:../vendor/* references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
56 lines
1.4 KiB
Docker
56 lines
1.4 KiB
Docker
# Build context: learning_ai_invt_trdg/ (monorepo root)
|
|
# docker-compose passes GITEA_NPM_TOKEN as a build arg for the private @bytelyst registry
|
|
#
|
|
# --- Stage 1: Build ---
|
|
FROM node:20-alpine AS builder
|
|
|
|
RUN corepack enable && corepack prepare pnpm@10.6.5 --activate
|
|
|
|
WORKDIR /app
|
|
|
|
ARG GITEA_NPM_TOKEN
|
|
ENV GITEA_NPM_TOKEN=${GITEA_NPM_TOKEN}
|
|
|
|
# Copy workspace root files first (layer cache)
|
|
COPY .npmrc pnpm-workspace.yaml pnpm-lock.yaml* ./
|
|
COPY package.json ./package.json
|
|
COPY backend/package.json ./backend/package.json
|
|
|
|
# Vendor packages — @bytelyst/* are file: references that must be present before pnpm install
|
|
COPY vendor/ ./vendor/
|
|
|
|
# Install backend deps only
|
|
RUN pnpm install --filter @bytelyst/trading-backend
|
|
|
|
# Copy source (backend + shared types used by tsconfig rootDir "..")
|
|
COPY backend/ ./backend/
|
|
COPY shared/ ./shared/
|
|
WORKDIR /app/backend
|
|
RUN pnpm run build
|
|
|
|
# --- Stage 2: Production ---
|
|
FROM node:20-alpine
|
|
|
|
RUN corepack enable && corepack prepare pnpm@10.6.5 --activate
|
|
|
|
WORKDIR /app
|
|
|
|
ARG GITEA_NPM_TOKEN
|
|
ENV GITEA_NPM_TOKEN=${GITEA_NPM_TOKEN}
|
|
|
|
COPY .npmrc pnpm-workspace.yaml pnpm-lock.yaml* ./
|
|
COPY package.json ./package.json
|
|
COPY backend/package.json ./backend/package.json
|
|
COPY vendor/ ./vendor/
|
|
|
|
RUN pnpm install --filter @bytelyst/trading-backend --prod
|
|
|
|
COPY --from=builder /app/backend/dist ./backend/dist
|
|
|
|
RUN chown -R node:node /app
|
|
USER node
|
|
|
|
WORKDIR /app/backend
|
|
EXPOSE 4018
|
|
CMD ["node", "dist/backend/src/bootstrap.js"]
|