FROM oven/bun:latest AS build

WORKDIR /app

COPY bun.lock* package.json ./
RUN bun install --frozen-lockfile

COPY . .
RUN bun run generate

FROM oven/bun:latest AS runner

WORKDIR /app
COPY --from=build /app/.output/public ./

EXPOSE 3000
CMD ["bun", "x", "serve", "--single"]
