Skip to content

Commit

Permalink
chore: change Docker to use bun
Browse files Browse the repository at this point in the history
  • Loading branch information
hanihusam committed Nov 18, 2024
1 parent ef9fd20 commit 1efbe37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# base node image
FROM node:18-bookworm-slim as base
# use the official Bun image
# see all versions at https://hub.docker.com/r/oven/bun/tags
FROM oven/bun:1 AS base

# set for base and all layer that inherit from it
ENV NODE_ENV production
Expand All @@ -13,8 +14,8 @@ FROM base as deps
RUN mkdir /myapp/
WORKDIR /myapp

ADD package.json .npmrc package-lock.json ./
RUN npm install --include=dev
ADD package.json bun.lockb ./
RUN bun install --frozen-lockfile

# Setup production node_modules
FROM base as production-deps
Expand All @@ -23,8 +24,8 @@ RUN mkdir /myapp/
WORKDIR /myapp/

COPY --from=deps /myapp/node_modules /myapp/node_modules
ADD package.json .npmrc package-lock.json ./
RUN npm prune --omit=dev
ADD package.json bun.lockb ./
RUN bun install --frozen-lockfile --production

# Build the app
FROM base as build
Expand All @@ -43,7 +44,7 @@ ADD prisma /myapp/prisma
RUN npx prisma generate

ADD . .
RUN npm run build
RUN bun run build

# Finally, build the production image with minimal footprint
FROM base
Expand Down
Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 1efbe37

Please sign in to comment.