File size: 698 Bytes
1f2d540
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8f1f40d
 
9f2ebf5
8f1f40d
1f2d540
 
 
8f1f40d
1f2d540
 
 
8f1f40d
1f2d540
8f1f40d
 
 
a17348e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Etapa 1: Build do frontend com Vite (Node.js)
FROM node:20 as frontend

WORKDIR /app

# Copiar apenas o necessário para o build
COPY package.json vite.config.ts tsconfig.json tailwind.config.js postcss.config.js ./
COPY public ./public
COPY components ./components
COPY services ./services
COPY lib ./lib
COPY App.tsx index.html index.tsx types.ts ./

RUN npm install
RUN npm run build

# Etapa 2: Backend com Flask
FROM python:3.10-slim

WORKDIR /code

# Instalar dependências Python
COPY requirements.txt ./
RUN pip install -r requirements.txt

# Copiar backend e build do frontend
COPY app.py ./
COPY --from=frontend /app/dist ./dist

# Expõe a porta
EXPOSE 7860

CMD ["python", "app.py"]