cfahlgren1 HF staff commited on
Commit
2fe081d
1 Parent(s): 025fed2
Files changed (4) hide show
  1. Dockerfile +11 -9
  2. bun.lockb +0 -0
  3. package-lock.json +0 -0
  4. package.json +2 -1
Dockerfile CHANGED
@@ -1,26 +1,26 @@
1
  # syntax=docker/dockerfile:1.4
2
 
3
- FROM node:20-alpine 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 package.json package-lock.json* ./
11
- RUN npm ci
12
 
13
  # Rebuild the source code only when needed
14
  FROM base AS builder
15
  WORKDIR /app
16
- COPY --from=deps /app/node_modules ./node_modules
17
- COPY . .
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 npm run build
24
 
25
  # Production image, copy all the files and run next
26
  FROM base AS runner
@@ -34,9 +34,11 @@ RUN \
34
  addgroup --system --gid 1001 nodejs; \
35
  adduser --system --uid 1001 nextjs
36
 
 
 
37
  # Automatically leverage output traces to reduce image size
38
- COPY --from=builder --chown=1001:1001 /app/.next/standalone ./
39
- COPY --from=builder --chown=1001:1001 /app/.next/static ./.next/static
40
 
41
  USER nextjs
42
 
@@ -44,4 +46,4 @@ EXPOSE 3000
44
 
45
  ENV PORT 3000
46
  ENV HOSTNAME 0.0.0.0
47
- CMD ["node", "server.js"]
 
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
 
34
  addgroup --system --gid 1001 nodejs; \
35
  adduser --system --uid 1001 nextjs
36
 
37
+ COPY --from=builder --link /app/.next ./.next
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
 
 
46
 
47
  ENV PORT 3000
48
  ENV HOSTNAME 0.0.0.0
49
+ CMD ["bun", "run", "server.js"]
bun.lockb ADDED
Binary file (174 kB). View file
 
package-lock.json DELETED
The diff for this file is too large to render. See raw diff
 
package.json CHANGED
@@ -32,5 +32,6 @@
32
  "postcss": "^8",
33
  "tailwindcss": "^3.4.1",
34
  "typescript": "^5"
35
- }
 
36
  }
 
32
  "postcss": "^8",
33
  "tailwindcss": "^3.4.1",
34
  "typescript": "^5"
35
+ },
36
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
37
  }