feat: build test-capable image, run tests, then build production image
Release / build-and-test (push) Has been cancelled
Release / build-and-test (push) Has been cancelled
This commit is contained in:
+22
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user