# Production image for the React UI (build + Vite preview; internal use).
FROM node:22-slim

WORKDIR /srv/frontend
COPY package.json package-lock.json ./
RUN npm ci
COPY . ./
RUN npm run build

ENV VITE_API_PROXY_TARGET=http://app:8000
EXPOSE 3000

CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "3000"]
