Last active
October 29, 2025 08:37
-
-
Save whchi/2194f0358eac6356b05cf28a3cdb604c to your computer and use it in GitHub Desktop.
bun with prisma and distroless example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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