feat(conversation-assistant): update e2e docker setup with npm registry config

This commit is contained in:
Lilith 2026-01-13 02:54:23 -08:00
parent 87d712a8be
commit e9454308a2
12 changed files with 107 additions and 75 deletions

View file

@ -5,9 +5,11 @@
# Full stack E2E testing with real database.
#
# Usage:
# NPM_TOKEN=$(grep _authToken ~/.npmrc | cut -d= -f2) docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
# docker compose -f docker-compose.e2e.yml up --build --abort-on-container-exit
# docker compose -f docker-compose.e2e.yml down -v
#
# Note: NPM_REGISTRY environment variable should be set (defaults to http://npm.nasty.sh/)
#
# =============================================================================
services:
@ -39,7 +41,13 @@ services:
context: .
dockerfile: e2e/Dockerfile.api
args:
NPM_TOKEN: ${NPM_TOKEN}
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: test
DATABASE_HOST: postgres
@ -73,7 +81,13 @@ services:
context: .
dockerfile: e2e/Dockerfile.frontend
args:
NPM_TOKEN: ${NPM_TOKEN}
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: test
VITE_API_URL: http://api:3000
@ -116,7 +130,13 @@ services:
context: .
dockerfile: e2e/Dockerfile.e2e
args:
NPM_TOKEN: ${NPM_TOKEN}
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
CI: "true"
NODE_ENV: test

View file

@ -13,11 +13,6 @@ WORKDIR /app
# Install pnpm globally (for running dev server)
RUN npm install -g pnpm@9
# Registry configuration (from docker-compose build args)
ARG NPM_REGISTRY=http://npm.nasty.sh/
RUN echo "@lilith:registry=${NPM_REGISTRY}" > .npmrc && \
echo "strict-ssl=false" >> .npmrc
# Copy workspace root package files
COPY codebase/package.json codebase/pnpm-lock.yaml codebase/pnpm-workspace.yaml ./
@ -25,10 +20,10 @@ COPY codebase/package.json codebase/pnpm-lock.yaml codebase/pnpm-workspace.yaml
COPY codebase/tsconfig.base.json ./
COPY codebase/features/frontend-showcase ./features/frontend-showcase/
COPY codebase/features/i18n/locales ./features/i18n/locales/
COPY codebase/@packages ./codebase/@packages
# Install dependencies (VPN routing via docker-compose extra_hosts)
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
# Copy pre-installed node_modules from host (already has @lilith/* packages)
COPY codebase/node_modules ./node_modules
COPY codebase/features/frontend-showcase/frontend/node_modules ./features/frontend-showcase/frontend/node_modules
# Set working directory to showcase frontend
WORKDIR /app/features/frontend-showcase/frontend

View file

@ -61,7 +61,8 @@
"@testing-library/jest-dom": "^6.0.0",
"@testing-library/react": "^16.0.0",
"@types/node": "^20.0.0",
"@types/react": "^18.0.0",
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"@vitejs/plugin-react": "^4.2.0",
"framer-motion": "^11.0.0",
"jsdom": "^24.0.0",

View file

@ -60,11 +60,15 @@ services:
build:
context: ../../../.. # Build from workspace root (4 levels up)
dockerfile: codebase/features/merchant/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
# VPN host entry for Forgejo registry (pnpm install from forge.nasty.sh)
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
# Runtime extra_hosts (for container networking)
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: test
@ -103,9 +107,13 @@ services:
build:
context: ../../../.. # Build from workspace root (4 levels up)
dockerfile: codebase/features/merchant/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
CI: "true"

View file

@ -9,13 +9,13 @@ import {
HttpStatus,
} from '@nestjs/common'
import {
GiftCardsService,
import type {
GiftCardPurchaseRequest,
GiftCardPurchaseResponse,
GiftCard,
VoteCalculation,
} from './gift-cards.service'
import { GiftCardsService } from './gift-cards.service'
/**
* Gift Cards Controller

View file

@ -11,7 +11,7 @@ import {
import { SegpayProvider } from '../segpay/segpay.provider'
// Re-export types for consumers
export { GiftCardStatus, GiftCardPurchaseRequest, GiftCardPurchaseResponse, VoteCalculation }
export type { GiftCardStatus, GiftCardPurchaseRequest, GiftCardPurchaseResponse, VoteCalculation }
/**
* Gift Card Entity (in-memory for now, replace with DB entity)

View file

@ -21,15 +21,15 @@ export class HealthController extends BaseHealthController {
super();
}
protected getVersion(): string {
protected override getVersion(): string {
return process.env.npm_package_version || '1.0.0';
}
protected getEnvironment(): string {
protected override getEnvironment(): string {
return process.env.NODE_ENV ?? 'development';
}
protected async checkDependencies(): Promise<DependencyHealth[]> {
protected override async checkDependencies(): Promise<DependencyHealth[]> {
return [
await this.checkRedis()
];
@ -44,7 +44,7 @@ export class HealthController extends BaseHealthController {
};
}
protected getMetadata(): Record<string, unknown> {
protected override getMetadata(): Record<string, unknown> {
return {
serviceName: 'payments',
port: 3600,

View file

@ -7,10 +7,10 @@ import {
UnauthorizedException,
BadRequestException,
Logger,
RawBodyRequest,
Req,
} from '@nestjs/common'
import { Request } from 'express'
import type { RawBodyRequest } from '@nestjs/common'
import type { Request } from 'express'
import { DomainEventsEmitter } from '@lilith/domain-events'
import { SegpayProvider } from '../segpay/segpay.provider'

View file

@ -15,6 +15,7 @@
],
"exclude": [
"node_modules",
"dist"
"dist",
"frontend-checkout"
]
}

View file

@ -66,11 +66,15 @@ services:
build:
context: ../../../..
dockerfile: features/analytics/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
# VPN host entry for Forgejo registry - required during build for pnpm install
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
# Runtime extra_hosts (for container networking)
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
# Use production mode to disable TypeORM synchronize (sync conflicts with TimescaleDB hypertables)
@ -106,9 +110,13 @@ services:
build:
context: ../../../..
dockerfile: features/platform-admin/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: production
@ -148,9 +156,13 @@ services:
build:
context: ../../../..
dockerfile: features/conversation-assistant/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: production
@ -182,9 +194,13 @@ services:
build:
context: ../../../..
dockerfile: features/marketplace/backend-api/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
NODE_ENV: production
@ -226,11 +242,15 @@ services:
build:
context: ../../../..
dockerfile: features/platform-admin/frontend-admin/Dockerfile.e2e
args:
NPM_REGISTRY: ${NPM_REGISTRY:-http://npm.nasty.sh/}
# VPN host entry for Forgejo registry - required during build for pnpm install
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
# Runtime extra_hosts (for container networking)
extra_hosts:
- "npm.nasty.sh:10.0.0.11"
- "forge.nasty.sh:10.0.0.11"
environment:
# Backend service URLs for Vite proxy

View file

@ -10,33 +10,17 @@ FROM node:20-alpine
WORKDIR /app
# Install pnpm
RUN npm install -g pnpm@9
# Registry configuration (from docker-compose build args)
ARG NPM_REGISTRY=http://npm.nasty.sh/
RUN echo "@lilith:registry=${NPM_REGISTRY}" > .npmrc && \
echo "strict-ssl=false" >> .npmrc
# Copy workspace files needed for pnpm
COPY codebase/package.json codebase/pnpm-lock.yaml codebase/pnpm-workspace.yaml ./
# Copy package files
COPY codebase/features/ui-dev-tools/backend-api/package.json ./features/ui-dev-tools/backend-api/
COPY codebase/@packages/ ./@packages/
COPY codebase/features/ui-dev-tools/backend-api/package.json ./
# Install dependencies (VPN routing via docker-compose extra_hosts)
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
# Copy workspace root node_modules (contains hoisted @lilith/* packages)
COPY codebase/node_modules ./node_modules
# Copy application source
COPY codebase/features/ui-dev-tools/backend-api/src/ ./features/ui-dev-tools/backend-api/src/
COPY codebase/features/ui-dev-tools/backend-api/tsconfig.json ./features/ui-dev-tools/backend-api/
# Copy feature-specific node_modules (if any)
COPY codebase/features/ui-dev-tools/backend-api/node_modules ./feature_node_modules
# Build the application
WORKDIR /app/features/ui-dev-tools/backend-api
RUN pnpm build
WORKDIR /app
# Copy application code
COPY codebase/features/ui-dev-tools/backend-api/dist/ ./dist/
# Create test data directory
RUN mkdir -p /app/test-data/features/i18n/locales
@ -46,7 +30,7 @@ EXPOSE 3016
# Health check endpoint
HEALTHCHECK --interval=5s --timeout=3s --start-period=10s \
CMD wget -q --spider http://localhost:3016/health || exit 1
CMD wget -q --spider http://localhost:3016/docs || exit 1
# Start application
CMD ["node", "dist/main.js"]

59
pnpm-lock.yaml generated
View file

@ -2181,13 +2181,16 @@ importers:
version: 6.9.1
'@testing-library/react':
specifier: ^16.0.0
version: 16.3.1(@testing-library/dom@10.4.1)(@types/react@18.3.27)(react-dom@19.2.3)(react@19.2.3)
version: 16.3.1(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3)(@types/react@19.2.8)(react-dom@19.2.3)(react@19.2.3)
'@types/node':
specifier: ^20.0.0
version: 20.19.27
'@types/react':
specifier: ^18.0.0
version: 18.3.27
specifier: ^19.0.0
version: 19.2.8
'@types/react-dom':
specifier: ^19.0.0
version: 19.2.3(@types/react@19.2.8)
'@vitejs/plugin-react':
specifier: ^4.2.0
version: 4.7.0(vite@6.4.1)
@ -12487,8 +12490,8 @@ packages:
styled-components: ^6.0.0
dependencies:
'@lilith/ui-theme': 1.2.0(react-dom@19.2.3)(react@19.2.3)(styled-components@6.1.19)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
cookie: 1.1.1
react: 19.2.3
react-dom: 19.2.3(react@19.2.3)
@ -12589,8 +12592,8 @@ packages:
dependencies:
'@lilith/ui-primitives': 1.2.3(react-dom@18.3.1)(react@19.2.3)(styled-components@6.1.19)
'@lilith/ui-theme': 1.2.0(react-dom@18.3.1)(react@19.2.3)(styled-components@6.1.19)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@18.3.1)(react@19.2.3)
lucide-react: 0.553.0(react@19.2.3)
motion-dom: 11.18.1
@ -12611,8 +12614,8 @@ packages:
dependencies:
'@lilith/ui-primitives': 1.2.3(react-dom@19.2.3)(react@19.2.3)(styled-components@6.1.19)
'@lilith/ui-theme': 1.2.0(react-dom@19.2.3)(react@19.2.3)(styled-components@6.1.19)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@19.2.3)(react@19.2.3)
lucide-react: 0.553.0(react@19.2.3)
motion-dom: 11.18.1
@ -12633,8 +12636,8 @@ packages:
dependencies:
'@lilith/ui-primitives': 1.2.4(react-dom@19.2.3)(react@19.2.3)(styled-components@6.1.19)
'@lilith/ui-theme': 1.2.0(react-dom@19.2.3)(react@19.2.3)(styled-components@6.1.19)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@19.2.3)(react@19.2.3)
lucide-react: 0.553.0(react@19.2.3)
motion-dom: 11.18.1
@ -12730,8 +12733,8 @@ packages:
styled-components: ^6.0.0
dependencies:
'@lilith/configs': 1.1.0(@typescript-eslint/eslint-plugin@8.52.0)(@typescript-eslint/parser@8.52.0)(@vitejs/plugin-react@4.7.0)(eslint-config-prettier@9.1.2)(eslint-plugin-import@2.32.0)(eslint-plugin-prettier@5.5.4)(eslint-plugin-react-hooks@7.0.1)(eslint-plugin-react@7.37.5)(eslint@9.39.2)(prettier@3.7.4)(typescript@5.9.3)(vite@5.4.21)(vitest@4.0.16)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
react: 19.2.3
react-dom: 19.2.3(react@19.2.3)
styled-components: 6.1.19(react-dom@19.2.3)(react@19.2.3)
@ -12761,8 +12764,8 @@ packages:
styled-components: ^6.0.0
dependencies:
'@lilith/configs': 1.1.0(@typescript-eslint/eslint-plugin@8.53.0)(@typescript-eslint/parser@8.53.0)(@vitejs/plugin-react@4.7.0)(eslint-config-prettier@9.1.2)(eslint-plugin-import@2.32.0)(eslint-plugin-prettier@5.5.4)(eslint-plugin-react-hooks@7.0.1)(eslint-plugin-react@7.37.5)(eslint@9.39.2)(prettier@3.7.4)(typescript@5.9.3)(vite@6.4.1)(vitest@4.0.17)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
react: 19.2.3
react-dom: 19.2.3(react@19.2.3)
styled-components: 6.1.19(react-dom@19.2.3)(react@19.2.3)
@ -12792,8 +12795,8 @@ packages:
styled-components: ^6.0.0
dependencies:
'@lilith/configs': 1.1.0(@typescript-eslint/eslint-plugin@8.53.0)(@typescript-eslint/parser@8.53.0)(@vitejs/plugin-react@4.7.0)(eslint-config-prettier@9.1.2)(eslint-plugin-import@2.32.0)(eslint-plugin-prettier@5.5.4)(eslint-plugin-react-hooks@7.0.1)(eslint-plugin-react@7.37.5)(eslint@9.39.2)(prettier@3.7.4)(typescript@5.9.3)(vite@6.4.1)(vitest@4.0.17)
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
react: 19.2.3
react-dom: 18.3.1(react@19.2.3)
styled-components: 6.1.19(react-dom@18.3.1)(react@19.2.3)
@ -13034,8 +13037,8 @@ packages:
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
dependencies:
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@18.3.1)(react@19.2.3)
motion-dom: 11.18.1
motion-utils: 11.18.1
@ -13050,8 +13053,8 @@ packages:
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
dependencies:
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@19.2.3)(react@19.2.3)
motion-dom: 11.18.1
motion-utils: 11.18.1
@ -13066,8 +13069,8 @@ packages:
react: ^18.0.0 || ^19.0.0
react-dom: ^18.0.0 || ^19.0.0
dependencies:
'@types/react': 19.2.7
'@types/react-dom': 19.2.3(@types/react@19.2.7)
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
framer-motion: 11.18.2(react-dom@19.2.3)(react@19.2.3)
motion-dom: 11.18.1
motion-utils: 11.18.1
@ -16399,7 +16402,7 @@ packages:
react-dom: 19.2.3(react@19.2.3)
dev: true
/@testing-library/react@16.3.1(@testing-library/dom@10.4.1)(@types/react@18.3.27)(react-dom@19.2.3)(react@19.2.3):
/@testing-library/react@16.3.1(@testing-library/dom@10.4.1)(@types/react-dom@19.2.3)(@types/react@19.2.8)(react-dom@19.2.3)(react@19.2.3):
resolution: {integrity: sha512-gr4KtAWqIOQoucWYD/f6ki+j5chXfcPc74Col/6poTyqTmn7zRmodWahWRCp8tYd+GMqBonw6hstNzqjbs6gjw==}
engines: {node: '>=18'}
peerDependencies:
@ -16416,7 +16419,8 @@ packages:
dependencies:
'@babel/runtime': 7.28.4
'@testing-library/dom': 10.4.1
'@types/react': 18.3.27
'@types/react': 19.2.8
'@types/react-dom': 19.2.3(@types/react@19.2.8)
react: 19.2.3
react-dom: 19.2.3(react@19.2.3)
dev: true
@ -17051,6 +17055,7 @@ packages:
'@types/react': ^19.2.0
dependencies:
'@types/react': 19.2.7
dev: true
/@types/react-dom@19.2.3(@types/react@19.2.8):
resolution: {integrity: sha512-jp2L/eY6fn+KgVVQAOqYItbF0VY/YApe5Mz2F0aykSO8gx31bYCZyvSeYxCHKvzHG5eZjc+zyaS5BrBWya2+kQ==}
@ -17058,13 +17063,12 @@ packages:
'@types/react': ^19.2.0
dependencies:
'@types/react': 19.2.8
dev: false
/@types/react-native@0.72.8(react-native@0.76.9):
resolution: {integrity: sha512-St6xA7+EoHN5mEYfdWnfYt0e8u6k2FR0P9s2arYgakQGFgU1f9FlPrIEcj0X24pLCF5c5i3WVuLCUdiCYHmOoA==}
dependencies:
'@react-native/virtualized-lists': 0.72.8(react-native@0.76.9)
'@types/react': 19.2.7
'@types/react': 19.2.8
transitivePeerDependencies:
- react-native
dev: true
@ -17084,7 +17088,6 @@ packages:
resolution: {integrity: sha512-3MbSL37jEchWZz2p2mjntRZtPt837ij10ApxKfgmXCTuHWagYg7iA5bqPw6C8BMPfwidlvfPI/fxOc42HLhcyg==}
dependencies:
csstype: 3.2.3
dev: false
/@types/redis@2.8.32:
resolution: {integrity: sha512-7jkMKxcGq9p242exlbsVzuJb57KqHRhNl4dHoQu2Y5v9bCAbtIXXH0R3HleSQW4CTOqpHIYUW3t6tpUj4BVQ+w==}