diff --git a/features/merchant/backend-api/Dockerfile.e2e b/features/merchant/backend-api/Dockerfile.e2e index 9bdee4421..5dac2ac26 100644 --- a/features/merchant/backend-api/Dockerfile.e2e +++ b/features/merchant/backend-api/Dockerfile.e2e @@ -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 diff --git a/features/merchant/backend-api/docker-compose.e2e.yml b/features/merchant/backend-api/docker-compose.e2e.yml index ad72120eb..85699d877 100644 --- a/features/merchant/backend-api/docker-compose.e2e.yml +++ b/features/merchant/backend-api/docker-compose.e2e.yml @@ -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: diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..11cc0a364 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist", + "rootDir": "." + }, + "include": [ + "features/**/*" + ], + "exclude": [ + "node_modules", + "dist", + "**/*.spec.ts", + "**/*.test.ts" + ] +}