cfahlgren1 HF Staff commited on
Commit
16a9059
·
1 Parent(s): 5e33ac4

add back docker file

Browse files
Files changed (1) hide show
  1. Dockerfile +49 -0
Dockerfile ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.4
2
+
3
+ FROM oven/bun:1 AS base
4
+
5
+ # Install dependencies only when needed
6
+ FROM base AS deps
7
+ WORKDIR /app
8
+
9
+ # Install dependencies based on the preferred package manager
10
+ COPY --link package.json bun.lockb* ./
11
+ RUN bun install --frozen-lockfile
12
+
13
+ # Rebuild the source code only when needed
14
+ FROM base AS builder
15
+ WORKDIR /app
16
+ COPY --from=deps --link /app/node_modules ./node_modules
17
+ COPY --link . .
18
+
19
+ # Next.js collects completely anonymous telemetry data about general usage.
20
+ # Uncomment the following line in case you want to disable telemetry during the build.
21
+ # ENV NEXT_TELEMETRY_DISABLED 1
22
+
23
+ RUN bun run build
24
+
25
+ # Production image, copy all the files and run next
26
+ FROM base AS runner
27
+ WORKDIR /app
28
+
29
+ ENV NODE_ENV production
30
+ # Uncomment the following line in case you want to disable telemetry during runtime.
31
+ # ENV NEXT_TELEMETRY_DISABLED 1
32
+
33
+ RUN \
34
+ addgroup --system --gid 1001 nodejs; \
35
+ adduser --system --uid 1001 nextjs
36
+
37
+ COPY --from=builder --link /app/public ./public
38
+
39
+ # Automatically leverage output traces to reduce image size
40
+ COPY --from=builder --link --chown=1001:1001 /app/.next/standalone ./
41
+ COPY --from=builder --link --chown=1001:1001 /app/.next/static ./.next/static
42
+
43
+ USER nextjs
44
+
45
+ EXPOSE 3000
46
+
47
+ ENV PORT 3000
48
+ ENV HOSTNAME 0.0.0.0
49
+ CMD ["bun", "run", "server.js"]