FROM oven/bun:1 AS build
WORKDIR /app

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

COPY front/ .
RUN bun run build-only

FROM nginx:alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY deploy/nginx/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
