-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 788 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 788 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
36
37
38
FROM oven/bun:alpine AS base
WORKDIR /usr/src/app
FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
COPY . .
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN bun run build
FROM base AS release
RUN adduser --system --uid 1001 nextjs
COPY --from=prerelease /usr/src/app/public ./public
RUN mkdir .next
RUN chown nextjs:bun .next
COPY --from=prerelease --chown=nextjs:bun /usr/src/app/.next/standalone ./
COPY --from=prerelease --chown=nextjs:bun /usr/src/app/.next/static ./.next/static
USER nextjs
EXPOSE 3000/tcp
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
ENV NEXT_TELEMETRY_DISABLED=1
CMD ["bun", "server.js"]