Skip to content

Instantly share code, notes, and snippets.

@whchi
Last active October 29, 2025 08:37
Show Gist options
  • Select an option

  • Save whchi/2194f0358eac6356b05cf28a3cdb604c to your computer and use it in GitHub Desktop.

Select an option

Save whchi/2194f0358eac6356b05cf28a3cdb604c to your computer and use it in GitHub Desktop.
bun with prisma and distroless example
FROM oven/bun:1.3.1 AS build
WORKDIR /app
# Cache packages installation
COPY package.json package.json
COPY bun.lock bun.lock
COPY ./prisma ./prisma
RUN bun install --frozen-lockfile
RUN bun prisma generate
COPY ./src ./src
ENV NODE_ENV=production
RUN bun build \
--compile \
--minify-whitespace \
--minify-syntax \
--target bun \
--outfile server \
./src/index.ts
FROM gcr.io/distroless/cc-debian12
WORKDIR /app
COPY --from=build /app/server server
COPY --from=build /app/generated generated
COPY --from=build /app/prisma prisma
ENV NODE_ENV=production
CMD ["./server"]
EXPOSE 3003
generator client {
provider = "prisma-client"
output = "../generated/prisma"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment