# Etapa 1: build React
FROM node:18-alpine as build
WORKDIR /app

COPY memberflow-frontend/package*.json ./
RUN npm install

COPY memberflow-frontend/ .
RUN npm run build

# Etapa 2: servir con nginx
FROM nginx:alpine
WORKDIR /usr/share/nginx/html

COPY --from=build /app/build .
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf

EXPOSE 80
