FROM node:22-alpine WORKDIR /opt/maxkb-app/ui COPY ui/package.json ./ RUN npm config set registry https://registry.npmmirror.com && \ npm install COPY ui/ ./ ENV NODE_OPTIONS="--max-old-space-size=4096" RUN npm run build-only && \ mv dist dist_admin && \ npm run build-only-chat && \ mv dist dist_chat && \ mv dist_admin/* dist_chat/ && \ mv dist_chat/chat dist_admin/ && \ rm -rf dist_chat && \ mv dist_admin dist FROM nginx:alpine COPY --from=0 /opt/maxkb-app/ui/dist /usr/share/nginx/html COPY ui/nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]