# Frontend — build React + serve with Nginx
FROM docker.1ms.run/node:20-alpine AS build

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --production=false
COPY . .
RUN npm run build

FROM docker.1ms.run/nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
# docker build -t dockerhub.genostack.com/library/law_order_frontend:v1 .