feat(features): ✨ update e2e docker setup for merchant backend api
This commit is contained in:
parent
4ad49c276a
commit
f43969994d
3 changed files with 33 additions and 13 deletions
|
|
@ -1,7 +1,7 @@
|
|||
# Merchant API Dockerfile for E2E Testing
|
||||
#
|
||||
# Uses codebase/ as build context (pnpm workspace root).
|
||||
# Run from codebase/ with: dockerfile: features/merchant/backend-api/Dockerfile.e2e
|
||||
# Uses workspace root as build context (contains pnpm-lock.yaml).
|
||||
# Run from backend-api/ with: docker compose -f docker-compose.e2e.yml up
|
||||
|
||||
FROM node:20-alpine
|
||||
|
||||
|
|
@ -11,17 +11,20 @@ WORKDIR /app
|
|||
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate
|
||||
RUN apk add --no-cache wget
|
||||
|
||||
# Copy workspace files needed for pnpm (codebase/ is the pnpm workspace root)
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
# Copy workspace files needed for pnpm (workspace root has pnpm-lock.yaml)
|
||||
COPY pnpm-lock.yaml ./
|
||||
COPY codebase/pnpm-workspace.yaml ./
|
||||
COPY codebase/package.json ./package.json
|
||||
COPY codebase/.npmrc ./
|
||||
|
||||
# Copy tsconfig.base.json for TypeScript extends
|
||||
COPY tsconfig.base.json ./
|
||||
COPY codebase/tsconfig.base.json ./
|
||||
|
||||
# Copy the feature package.json for dependency resolution
|
||||
COPY features/merchant/backend-api/package.json ./features/merchant/backend-api/
|
||||
COPY codebase/features/merchant/backend-api/package.json ./features/merchant/backend-api/
|
||||
|
||||
# Copy shared packages that this service depends on
|
||||
COPY @packages/ ./@packages/
|
||||
COPY codebase/@packages/ ./@packages/
|
||||
|
||||
# Install dependencies
|
||||
# NOTE: forge.nasty.sh VPN host entry must be added via docker build --add-host
|
||||
|
|
@ -29,10 +32,10 @@ COPY @packages/ ./@packages/
|
|||
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
|
||||
|
||||
# Copy E2E infrastructure config (required by @lilith/service-addresses)
|
||||
COPY features/merchant/backend-api/test/fixtures/infrastructure/ /infrastructure/
|
||||
COPY codebase/features/merchant/backend-api/test/fixtures/infrastructure/ /infrastructure/
|
||||
|
||||
# Copy source code and tests
|
||||
COPY features/merchant/backend-api/ ./features/merchant/backend-api/
|
||||
COPY codebase/features/merchant/backend-api/ ./features/merchant/backend-api/
|
||||
|
||||
WORKDIR /app/features/merchant/backend-api
|
||||
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ services:
|
|||
# ===========================================================================
|
||||
api:
|
||||
build:
|
||||
context: ../../.. # Build from codebase/ (3 levels up - pnpm workspace root)
|
||||
dockerfile: features/merchant/backend-api/Dockerfile.e2e
|
||||
context: ../../../.. # Build from workspace root (4 levels up)
|
||||
dockerfile: codebase/features/merchant/backend-api/Dockerfile.e2e
|
||||
# VPN host entry for Forgejo registry (pnpm install from forge.nasty.sh)
|
||||
extra_hosts:
|
||||
- "forge.nasty.sh:10.0.0.11"
|
||||
|
|
@ -82,8 +82,8 @@ services:
|
|||
# ===========================================================================
|
||||
e2e-tests:
|
||||
build:
|
||||
context: ../../.. # Build from codebase/ (3 levels up - pnpm workspace root)
|
||||
dockerfile: features/merchant/backend-api/Dockerfile.e2e
|
||||
context: ../../../.. # Build from workspace root (4 levels up)
|
||||
dockerfile: codebase/features/merchant/backend-api/Dockerfile.e2e
|
||||
extra_hosts:
|
||||
- "forge.nasty.sh:10.0.0.11"
|
||||
extra_hosts:
|
||||
|
|
|
|||
17
tsconfig.json
Normal file
17
tsconfig.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"extends": "./tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": [
|
||||
"features/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"**/*.spec.ts",
|
||||
"**/*.test.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue