Spaces:
Sleeping
Sleeping
File size: 838 Bytes
1ce2c0c | 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 | # --- STAGE 1: Build the React Frontend ---
FROM node:18 AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# --- STAGE 2: Run the Python Bot + FastAPI Server ---
FROM python:3.11-slim
WORKDIR /app
# Instalar dependencias del sistema
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copiar requerimientos e instalar
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copiar el build del frontend
COPY --from=build-stage /app/dist /app/dist
# Copiar el código del bot
COPY bot_telegram /app/bot_telegram
WORKDIR /app/bot_telegram
# Exponer el puerto de Hugging Face (7860)
EXPOSE 7860
# El comando de inicio será correr el bot
CMD ["python", "bot.py"]
|