FROM oven/bun:alpine AS build
WORKDIR /app
COPY website/package.json website/bun.lock ./
RUN bun install --frozen-lockfile
COPY website/ ./
RUN bun run build

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