-
-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 741 Bytes
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 741 Bytes
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
FROM oven/bun:alpine AS base
WORKDIR /app
FROM base AS deps
RUN apk add --no-cache python3 make g++ git
COPY bun.lock package.json ./
COPY source.config.ts tsconfig.json ./
RUN mkdir -p content/docs
RUN bun install --frozen-lockfile
FROM base AS builder
WORKDIR /app
RUN apk add --no-cache git
COPY --from=deps /app/node_modules ./node_modules
COPY . .
COPY .git ./.git
ENV NEXT_TELEMETRY_DISABLED=1
RUN bun run build
FROM oven/bun:alpine AS runner
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
WORKDIR /app
RUN apk add --no-cache git
COPY --from=builder --chown=nextjs:nodejs /app .
USER nextjs
EXPOSE 8080
ENV NODE_ENV=production
ENV PORT=8080
ENV HOSTNAME="0.0.0.0"
CMD ["bun", "run", "start"]