Files
LP-Trablhista/Dockerfile
2025-11-21 20:55:33 +00:00

30 lines
648 B
Docker

# Etapa 1 - Build da aplicação Vite
FROM node:18 as build
WORKDIR /app
# Copiar o zip para dentro do container
COPY app.zip .
# Instalar unzip e extrair o conteúdo
RUN apt-get update && apt-get install -y unzip && \
unzip app.zip -d unzip && \
rm app.zip
# Detectar e mover o conteúdo para /app
RUN mv unzip/*/* ./ || mv unzip/* ./ && rm -rf unzip
# Instalar dependências e buildar
RUN npm install && npm run build
# Etapa 2 - Servir com NGINX
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
RUN rm -f /usr/share/nginx/html/index.html.orig 2>/dev/null || true
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]