fix(e2e): 🐛 update docker-compose.e2e.yml for full platform-admin E2E testing
This commit is contained in:
parent
b322f601b6
commit
3fba804099
3 changed files with 104 additions and 6 deletions
47
features/attributes/backend-api/Dockerfile.e2e
Normal file
47
features/attributes/backend-api/Dockerfile.e2e
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Attributes API Dockerfile for E2E Testing
|
||||
#
|
||||
# Uses workspace root context for proper pnpm workspace resolution.
|
||||
# Run from codebase/ with: dockerfile: features/attributes/backend-api/Dockerfile.e2e
|
||||
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm@9
|
||||
|
||||
# Copy workspace files needed for pnpm
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
|
||||
# Copy the feature package.json for dependency resolution
|
||||
COPY features/attributes/backend-api/package.json ./features/attributes/backend-api/
|
||||
|
||||
# Copy shared packages that this service depends on
|
||||
COPY @packages/ ./@packages/
|
||||
|
||||
# Install dependencies
|
||||
# NOTE: forge.nasty.sh VPN host entry must be added via docker build --add-host
|
||||
# Use --ignore-scripts to skip workspace package prepare scripts that need full context
|
||||
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
|
||||
|
||||
# Copy source code
|
||||
COPY features/attributes/backend-api/ ./features/attributes/backend-api/
|
||||
|
||||
WORKDIR /app/features/attributes/backend-api
|
||||
|
||||
# Build the application
|
||||
RUN pnpm build
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3015
|
||||
|
||||
# Environment defaults
|
||||
ENV PORT=3015
|
||||
ENV NODE_ENV=test
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3015/health || exit 1
|
||||
|
||||
# Start the server
|
||||
CMD ["node", "dist/main.js"]
|
||||
47
features/email/backend-api/Dockerfile.e2e
Normal file
47
features/email/backend-api/Dockerfile.e2e
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
# Email API Dockerfile for E2E Testing
|
||||
#
|
||||
# Uses workspace root context for proper pnpm workspace resolution.
|
||||
# Run from codebase/ with: dockerfile: features/email/backend-api/Dockerfile.e2e
|
||||
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install pnpm
|
||||
RUN npm install -g pnpm@9
|
||||
|
||||
# Copy workspace files needed for pnpm
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml .npmrc ./
|
||||
|
||||
# Copy the feature package.json for dependency resolution
|
||||
COPY features/email/backend-api/package.json ./features/email/backend-api/
|
||||
|
||||
# Copy shared packages that this service depends on
|
||||
COPY @packages/ ./@packages/
|
||||
|
||||
# Install dependencies
|
||||
# NOTE: forge.nasty.sh VPN host entry must be added via docker build --add-host
|
||||
# Use --ignore-scripts to skip workspace package prepare scripts that need full context
|
||||
RUN pnpm install --frozen-lockfile --ignore-scripts || pnpm install --ignore-scripts
|
||||
|
||||
# Copy source code
|
||||
COPY features/email/backend-api/ ./features/email/backend-api/
|
||||
|
||||
WORKDIR /app/features/email/backend-api
|
||||
|
||||
# Build the application
|
||||
RUN pnpm build
|
||||
|
||||
# Expose port
|
||||
EXPOSE 3013
|
||||
|
||||
# Environment defaults
|
||||
ENV PORT=3013
|
||||
ENV NODE_ENV=test
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=10s --timeout=3s --start-period=20s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3013/health || exit 1
|
||||
|
||||
# Start the server
|
||||
CMD ["node", "dist/main.js"]
|
||||
|
|
@ -1,17 +1,20 @@
|
|||
# =============================================================================
|
||||
# Platform Admin E2E Docker Environment
|
||||
# =============================================================================
|
||||
# Self-contained test environment for conversion funnels E2E testing.
|
||||
# Sets up PostgreSQL, seeds data, runs analytics backend, and frontend.
|
||||
# Self-contained test environment for full platform-admin E2E testing.
|
||||
# Sets up PostgreSQL, seeds data, runs all backend services, and frontend.
|
||||
#
|
||||
# Usage:
|
||||
# docker compose -f e2e/docker-compose.e2e.yml up --build --abort-on-container-exit
|
||||
# docker compose -f e2e/docker-compose.e2e.yml down -v
|
||||
#
|
||||
# Services:
|
||||
# - postgres: Analytics database with seeded conversion events
|
||||
# - redis: Cache for analytics backend
|
||||
# - analytics-api: Backend API serving funnel data
|
||||
# - postgres: Analytics database with seeded data for all routes
|
||||
# - redis: Cache for backend services
|
||||
# - analytics-api: Analytics backend API
|
||||
# - platform-admin-api: Admin BFF (Backend For Frontend)
|
||||
# - email-api: Email service backend
|
||||
# - attributes-api: Attributes service backend
|
||||
# - platform-admin: Frontend under test
|
||||
# - e2e-runner: Playwright test runner
|
||||
# =============================================================================
|
||||
|
|
@ -28,7 +31,8 @@ services:
|
|||
# Schema and seed data (files run in alphabetical order)
|
||||
- ./fixtures/00-e2e-schema.sql:/docker-entrypoint-initdb.d/00-e2e-schema.sql:ro
|
||||
- ../../../analytics/database/schema.sql:/docker-entrypoint-initdb.d/01-analytics-schema.sql:ro
|
||||
- ./fixtures/seed-conversion-events.sql:/docker-entrypoint-initdb.d/02-seed.sql:ro
|
||||
- ./fixtures/seed-conversion-events.sql:/docker-entrypoint-initdb.d/02-seed-conversion.sql:ro
|
||||
- ./fixtures/seed-analytics.sql:/docker-entrypoint-initdb.d/03-seed-analytics.sql:ro
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U analytics -d analytics_e2e"]
|
||||
interval: 5s
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue