-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
FROM oven/bun | ||
FROM oven/bun AS builder | ||
WORKDIR /app | ||
|
||
COPY package.json . | ||
COPY bun.lock . | ||
COPY package.json bun.lock . | ||
RUN bun install --production | ||
|
||
COPY src src | ||
COPY tsconfig.json . | ||
COPY drizzle drizzle | ||
COPY drizzle drizzle | ||
COPY tsconfig.json . | ||
|
||
ENV NODE_ENV=production | ||
RUN bun build \ | ||
--compile \ | ||
--minify-whitespace \ | ||
--minify-syntax \ | ||
--target bun \ | ||
--outfile server \ | ||
./src/index.ts | ||
|
||
ENV NODE_ENV production | ||
FROM gcr.io/distroless/base | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app/server server | ||
|
||
ENV NODE_ENV=production | ||
EXPOSE 3000 | ||
CMD ["bun", "src/index.ts"] | ||
CMD ["./server"] | ||
|