FROM oven/bun:latest AS build

ADD * /app/
WORKDIR /app
RUN bun install && \
    bun run astro build

FROM node:22-alpine
WORKDIR /app
COPY --from=build /app/dist ./dist
COPY --from=build /app/package.json ./package.json
COPY --from=build /app/node_modules ./node_modules
EXPOSE 3000
CMD ["node", "dist/server/entry.mjs"]