FROM oven/bun:1 AS builder
WORKDIR /app
COPY . .
RUN bun install
RUN cd apps/server && bun run build

FROM oven/bun:1-slim
WORKDIR /app
COPY --from=builder /app/apps/server/dist ./dist
COPY --from=builder /app/node_modules ./node_modules
EXPOSE 3000
CMD ["bun", "run", "dist/index.js"]
