FROM node:22-alpine AS build

WORKDIR /app

COPY apps/ui/package.json apps/ui/package-lock.json ./
RUN npm ci

COPY apps/ui ./
COPY Crank.png ./Crank.png

RUN npm run build

FROM nginx:1.27-alpine

COPY apps/ui/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 3000
