From 26eff2779bfee4e1faf678aa482ebaf8ef58fcef Mon Sep 17 00:00:00 2001 From: wander Date: Fri, 21 Nov 2025 21:00:24 +0000 Subject: [PATCH] Atualizar Dockerfile --- Dockerfile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 021487d..e9e639b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,18 @@ # Etapa 1 - Build da aplicação Vite -FROM node:18 as build +FROM node:18 AS build WORKDIR /app -# Copiar o zip para dentro do container +# Copiar o ZIP para dentro do container COPY app.zip . -# Instalar unzip e extrair o conteúdo +# Instalar unzip e extrair diretamente em /app RUN apt-get update && apt-get install -y unzip && \ - unzip app.zip -d unzip && \ + unzip app.zip -d . && \ rm app.zip -# Detectar e mover o conteúdo para /app -RUN mv unzip/*/* ./ || mv unzip/* ./ && rm -rf unzip +# (opcional para debug: ver se o package.json está aqui) +# RUN ls -la && ls -la src # Instalar dependências e buildar RUN npm install && npm run build @@ -20,9 +20,11 @@ RUN npm install && npm run build # Etapa 2 - Servir com NGINX FROM nginx:alpine +# Copiar a pasta dist gerada pelo Vite COPY --from=build /app/dist /usr/share/nginx/html -RUN rm -f /usr/share/nginx/html/index.html.orig 2>/dev/null || true +# Remover index default do nginx, se existir +RUN rm -f /usr/share/nginx/html/index.html 2>/dev/null || true EXPOSE 80