-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (33 loc) · 1.04 KB
/
Copy pathDockerfile
File metadata and controls
44 lines (33 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM oven/bun:alpine AS base
FROM base AS deps
WORKDIR /app
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
FROM node:22-alpine AS builder
WORKDIR /app
# Install build dependencies
RUN apk add --no-cache libc6-compat python3 make g++
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build with Node.js
ENV NODE_ENV=production
ENV SKIP_ENV_VALIDATION=true
RUN npm run build
# Production image, copy all the files and run next
FROM builder AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXTAUTH_URL=http://localhost:3000
ENV NEXTAUTH_SECRET=secret
ENV FRITZBOX_HOST=fritz.box
ENV FRITZBOX_PORT=49000
ENV FRITZBOX_SSL=0
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=builder /app/public ./public
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
CMD HOSTNAME="0.0.0.0" node server.js