feat: build test-capable image, run tests, then build production image
Release / build-and-test (push) Has been cancelled

This commit is contained in:
2026-03-31 19:27:59 -07:00
parent d39172ca44
commit 9416159712
2 changed files with 60 additions and 34 deletions
+22 -1
View File
@@ -26,7 +26,28 @@ RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" npx prisma genera
ARG GIT_COMMIT=unknown
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" NEXT_PUBLIC_GIT_COMMIT=$GIT_COMMIT npm run build
# Stage 2: Runner
# Stage 2: Test runner (includes dev dependencies for testing)
FROM node:20-alpine AS test-runner
# Install dependencies
RUN apk add --no-cache python3 make g++ git
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install ALL dependencies (including dev dependencies for testing)
RUN npm ci
# Copy source code
COPY . .
# Generate Prisma client
RUN DATABASE_URL="postgresql://user:pass@localhost:5432/dummy" npx prisma generate
# Stage 3: Production runner
FROM node:20-alpine AS runner
# Install dumb-init for proper signal handling