build(api): refresh bun config
This commit is contained in:
@@ -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"]
|
||||
|
||||
Reference in New Issue
Block a user