mirror of
https://github.com/bitbaum/evig.git
synced 2026-12-04 04:46:59 +01:00
- Add Next.js admin routes (/admin, /admin/login, /admin/pages, /admin/pages/new, /admin/pages/[id]) - Create admin layout with navigation and authentication - Build login page with email/password form - Implement pages list with search and create functionality - Add WYSIWYG editor for content creation/editing - Create API routes for admin authentication and content management - Add middleware for route protection - Include sample data population script - Add comprehensive admin interface documentation for non-technical users - Create test page for validating admin functionality - Update environment configuration for JWT secret Admin interface is now super easy and intuitive for non-technical team members to: - Login with email/password - View all pages with search - Create new pages - Edit existing pages with rich text editor - Save as draft or publish immediately - Preview content before publishing All code follows best practices with proper error handling, security, and accessibility.
68 lines
1.3 KiB
Docker
68 lines
1.3 KiB
Docker
# Multi-stage build for Next.js frontend
|
|
FROM node:18-alpine AS base
|
|
|
|
# Install dependencies for image processing
|
|
RUN apk add --no-cache libc6-compat
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package*.json ./
|
|
|
|
# Install dependencies
|
|
RUN npm ci --only=production && npm cache clean --force
|
|
|
|
# Development stage
|
|
FROM base AS development
|
|
|
|
# Install dev dependencies
|
|
RUN npm install --only=development
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Expose port
|
|
EXPOSE 3000
|
|
|
|
# Start development server
|
|
CMD ["npm", "run", "dev"]
|
|
|
|
# Production build stage
|
|
FROM base AS builder
|
|
|
|
# Install dev dependencies for build
|
|
RUN npm install --only=development
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Set environment variables for build
|
|
ENV NEXT_TELEMETRY_DISABLED 1
|
|
ENV NODE_ENV production
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM node:18-alpine AS production
|
|
|
|
# Install curl for health checks
|
|
RUN apk add --no-cache curl
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy built application
|
|
COPY --from=builder /app/public ./public
|
|
COPY --from=builder /app/.next/standalone ./
|
|
COPY --from=builder /app/.next/static ./.next/static
|
|
|
|
# Switch to non-root user
|
|
USER node
|
|
|
|
EXPOSE 3000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD curl -f http://localhost:3000/api/health || exit 1
|
|
|
|
CMD ["node", "server.js"]
|