# Etapa 1 - build da aplicação FROM node:18 as build WORKDIR /app # Instalar unzip e descompactar o .zip COPY app.zip . RUN apt-get update && apt-get install -y unzip && \ unzip app.zip -d unzip && \ rm app.zip # Detectar o diretório correto e mover para /app RUN mv unzip/* . && rm -rf unzip # Rodar build da aplicação RUN npm install && npm run build # Etapa 2 - servir com nginx FROM nginx:alpine COPY --from=build /app/dist /usr/share/nginx/html # Remover página padrão do nginx, se existir RUN rm -f /usr/share/nginx/html/index.html.orig 2>/dev/null || true EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]