Files
kidsai/Dockerfile
mindesbunister b31492a354 Complete Docker migration with Next.js 15 and cleaned design
- Migrated from Express.js to Next.js 15 with TypeScript
- Added Docker Compose v2 with multi-stage builds
- Implemented Docker Bake support for improved builds
- Created professional component structure with Tailwind CSS
- Added enhanced visual design with glass morphism effects
- Improved responsive layout and better UX flow
- Updated all dependencies and configurations
- Added proper TypeScript types and modern practices
- Created development scripts for easy container management
- Cleaned up excessive animations for better user experience
2025-07-14 10:11:06 +02:00

58 lines
1.2 KiB
Docker

# Multi-stage Dockerfile for better build performance with Docker Bake
FROM node:20-alpine AS base
# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Copy package files
COPY package*.json ./
RUN npm install --production=false && npm cache clean --force
# Development stage
FROM base AS development
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 3444
ENV PORT 3444
ENV NODE_ENV development
CMD ["npm", "run", "dev"]
# Build stage
FROM base AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM base AS production
WORKDIR /app
ENV NODE_ENV production
ENV PORT 3444
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy production dependencies
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/package*.json ./
# Copy built application
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
USER nextjs
EXPOSE 3444
CMD ["node", "server.js"]