salomonsky commited on
Commit
8012183
verified
1 Parent(s): 0c956ba

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Imagen base para Node.js
2
+ FROM node:16 AS frontend
3
+
4
+ # Establecer el directorio de trabajo
5
+ WORKDIR /app
6
+
7
+ # Copiar archivos de frontend
8
+ COPY package.json package-lock.json ./
9
+
10
+ # Instalar dependencias de Node.js
11
+ RUN npm install
12
+
13
+ # Copiar el c贸digo fuente de React
14
+ COPY . .
15
+
16
+ # Construir el frontend
17
+ RUN npm run build
18
+
19
+ # Imagen base para Python (Streamlit)
20
+ FROM python:3.8 AS backend
21
+
22
+ # Establecer el directorio de trabajo
23
+ WORKDIR /app
24
+
25
+ # Copiar las dependencias de Python
26
+ COPY requirements.txt ./
27
+
28
+ # Instalar dependencias de Python
29
+ RUN pip install --no-cache-dir -r requirements.txt
30
+
31
+ # Copiar c贸digo Python (backend) y el frontend construido
32
+ COPY --from=frontend /app/build /app/frontend
33
+
34
+ # Copiar el archivo de Streamlit
35
+ COPY app.py ./
36
+
37
+ # Exponer el puerto para Streamlit
38
+ EXPOSE 8501
39
+
40
+ # Comando para ejecutar Streamlit
41
+ CMD ["streamlit", "run", "app.py"]