From 1efbe3726f60729b4114e54c5329ec1d5813ac03 Mon Sep 17 00:00:00 2001 From: Hani Husamuddin Date: Mon, 18 Nov 2024 19:54:56 +0700 Subject: [PATCH] chore: change Docker to use bun --- Dockerfile | 15 ++++++++------- bun.lockb | Bin 714360 -> 714360 bytes 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb3b797..ddc86d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/bun.lockb b/bun.lockb index 8c3815fb9ff46b64f7ff0d7856246247b15953c3..823fd6375a670d755c96fd91c96b6032bcf523ca 100755 GIT binary patch delta 51 zcmexyM*GJZ?S>Y{7N!>F7M2#)7Pc+ycPls<<4p7n&Gih8+n-gi12G2>b8dfD!8Iut E01jppMF0Q* delta 51 ycmexyM*GJZ?S>Y{7N!>F7M2#)7Pc+ycPluV7@(m2Sp_=~a{w{t_GcAblX3y({t}D;