From 9466fa3c24e28c8a3900eeb67fdffcf04ad6ac18 Mon Sep 17 00:00:00 2001 From: evenegas Date: Thu, 5 Jun 2025 09:27:23 -0600 Subject: [PATCH] =?UTF-8?q?se=20dockeriz=C3=B3=20el=20proyecto?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 19 +++++++++++++++++++ inicializar_proyecto.txt | 15 +++++++++++++++ requirements.txt | 4 ++++ 3 files changed, 38 insertions(+) create mode 100644 Dockerfile create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bac8c0b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Imagen base ligera con Python 3.11 +FROM python:3.11-slim + +# Establecer el directorio de trabajo +WORKDIR /app + +# Copiar archivos necesarios +COPY requirements.txt . +COPY qa_fenix.jsonl . +COPY chat_semantic_fenix_score.py . + +# Instalar dependencias +RUN pip install --no-cache-dir -r requirements.txt + +# Exponer el puerto de FastAPI +EXPOSE 8000 + +# Comando para iniciar el servidor +CMD ["uvicorn", "chat_semantic_fenix_score:app", "--host", "0.0.0.0", "--port", "8000"] diff --git a/inicializar_proyecto.txt b/inicializar_proyecto.txt index 152f8d7..b9dd968 100644 --- a/inicializar_proyecto.txt +++ b/inicializar_proyecto.txt @@ -6,3 +6,18 @@ //curl -X POST http://127.0.0.1:8000/chat \ -H "Content-Type: application/json" \ -d '{"user_input": "¿Cuál es el horario de atención?", "threshold": 0.65}' + +curl -X POST http://127.0.0.1:8000/chat \ + -H "Content-Type: application/json" \ + -d '{"user_input": "Qué servicios tienenen el cedetec", "threshold": 0.65}' + +curl -X POST http://127.0.0.1:8000/chat \ + -H "Content-Type: application/json" \ + -d '{"user_input": "dime los servicios tienenen el cedetec", "threshold": 0.65}' + + +//docker +dockebuild -t bot-api . + +//inicializar servidor en docker +docker run -p 8000:8000 bot-api \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..01a0c08 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,4 @@ +fastapi +uvicorn[standard] +sentence-transformers +faiss-cpu \ No newline at end of file