build(api): refresh bun config

This commit is contained in:
William Valentin
2025-10-17 09:54:14 -07:00
parent aec89c6f5a
commit 37411bc890
5 changed files with 5403 additions and 951 deletions

View File

@@ -1,20 +1,17 @@
# syntax=docker/dockerfile:1
# ARG NODE_VERSION=20-alpine
ARG BUN_VERSION=1.0.0
# FROM node:${NODE_VERSION} AS base
FROM oven/bun:latest AS base
FROM oven/bun:${BUN_VERSION} AS base
WORKDIR /app
FROM base AS deps
COPY package.json ./
# Install only production dependencies for the runtime image
RUN bun install --omit=dev
COPY package.json bun.lock ./
RUN bun install --production --no-cache
FROM base AS build
COPY package.json ./
# Install all dependencies for building (includes devDeps like typescript)
RUN bun install
COPY package.json bun.lock ./
RUN bun install --no-cache
COPY tsconfig.json ./
COPY src ./src
RUN bun run build
@@ -23,8 +20,8 @@ FROM base AS runner
ENV NODE_ENV=production
USER bun
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --link --from=deps /app/node_modules ./node_modules
COPY --link --from=build /app/dist ./dist
COPY package.json ./
COPY --from=build /app/dist ./dist
EXPOSE 3000
CMD ["bun", "dist/app.js"]
CMD ["bun", "run", "dist/app.js"]