Files
breakpilot-core/pitch-deck/Dockerfile
Benjamin Admin c374600833 fix(pitch-deck): set proper ownership on public/ dir for standalone mode
Screenshots were owned by root but Next.js standalone runs as nextjs user,
causing image optimization to fail with 'not a valid image' error.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 20:57:51 +01:00

46 lines
827 B
Docker

# Build stage
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm install
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM node:20-alpine AS runner
WORKDIR /app
# Set to production
ENV NODE_ENV=production
# Create non-root user
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy built assets
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# Switch to non-root user
USER nextjs
# Expose port
EXPOSE 3000
# Set hostname
ENV HOSTNAME="0.0.0.0"
# Start the application
CMD ["node", "server.js"]