Skip to content

Commit

Permalink
Use bun build in the dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
zoriya committed Jan 18, 2025
1 parent ce242bf commit 87314a0
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions api/Dockerfile
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"]

0 comments on commit 87314a0

Please sign in to comment.