Files
snippet-pastebin/Dockerfile
johndoe6345789 dd33d9823d Add comprehensive E2E tests for functionality, mobile responsiveness, and visual regression
- Implemented functionality tests covering page navigation, header behavior, form handling, and error management.
- Created mobile-responsive tests to ensure touch interactions, viewport adaptability, and safe area respect.
- Developed visual regression tests for home page layout, typography, color consistency, and interactive elements.
- Added a test runner script for easier execution of E2E tests with various options.
2026-01-20 01:29:32 +00:00

39 lines
785 B
Docker

# Build stage (use build platform to keep multi-arch builds off QEMU)
FROM --platform=$BUILDPLATFORM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package*.json ./
RUN npm ci
# Copy source code
COPY . .
# Build arguments for environment variables
ARG NEXT_PUBLIC_FLASK_BACKEND_URL
ARG NEXT_PUBLIC_BASE_PATH
ENV NEXT_PUBLIC_FLASK_BACKEND_URL=$NEXT_PUBLIC_FLASK_BACKEND_URL
ENV NEXT_PUBLIC_BASE_PATH=$NEXT_PUBLIC_BASE_PATH
# Build Next.js app
RUN npm run build
# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
# Copy necessary files from builder
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]