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

FROM nginx:alpine
COPY --from=builder /app/apps/web/dist /usr/share/nginx/html
COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
