File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM oven/bun:1 AS deps
2+ WORKDIR /app
3+
4+ # Copy package files
5+ COPY package.json bun.lockb* ./
6+ RUN bun install --frozen-lockfile
7+
8+ FROM node:20-alpine AS builder
9+ WORKDIR /app
10+
11+ COPY --from=deps /app/node_modules ./node_modules
12+ COPY . .
13+
14+ RUN npm run build
15+
16+ FROM oven/bun:1-alpine AS runner
17+ WORKDIR /app
18+
19+ # Create non-root user
20+ RUN addgroup --system --gid 1001 nodejs && \
21+ adduser --system --uid 1001 nextjs
22+
23+ COPY --from=builder /app/public ./public
24+ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
25+ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
26+
27+ USER nextjs
28+
29+ EXPOSE 3000
30+
31+ CMD ["bun" , "run" , "server.js" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+ services :
3+ nextjs :
4+ build : .
5+ ports :
6+ - " 3000:3000"
7+ environment :
8+ - NODE_ENV=production
Original file line number Diff line number Diff line change 1-
21/** @type {import('next').NextConfig } */
32const nextConfig = {
4-
5-
3+ output : "standalone" ,
64} ;
75
8-
9-
10- export default nextConfig
6+ export default nextConfig ;
Original file line number Diff line number Diff line change 1+ FROM oven/bun:1 AS deps
2+ WORKDIR /app
3+
4+ # Copy package files
5+ COPY package.json bun.lockb* ./
6+ RUN bun install --frozen-lockfile
7+
8+ FROM node:20-alpine AS builder
9+ WORKDIR /app
10+
11+ COPY --from=deps /app/node_modules ./node_modules
12+ COPY . .
13+
14+ RUN npm run build
15+
16+ FROM oven/bun:1-alpine AS runner
17+ WORKDIR /app
18+
19+ # Create non-root user
20+ RUN addgroup --system --gid 1001 nodejs && \
21+ adduser --system --uid 1001 nextjs
22+
23+ COPY --from=builder /app/public ./public
24+ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
25+ COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
26+
27+ USER nextjs
28+
29+ EXPOSE 3000
30+
31+ CMD ["bun" , "run" , "server.js" ]
Original file line number Diff line number Diff line change 1+ version : ' 3.8'
2+ services :
3+ nextjs :
4+ build : .
5+ ports :
6+ - " 3000:3000"
7+ environment :
8+ - NODE_ENV=production
You can’t perform that action at this time.
0 commit comments