| # Usa una imagen base oficial de Python | |
| FROM python:3.12 | |
| # Agrega un usuario no root | |
| RUN useradd -m -u 1000 app | |
| # Establece el directorio de trabajo dentro del contenedor | |
| WORKDIR /home/app | |
| RUN apt update | |
| RUN apt install -y wget make cmake clang git g++ | |
| RUN wget https://huggingface.co/Qwen/Qwen2-0.5B-Instruct-GGUF/resolve/main/qwen2-0_5b-instruct-q5_0.gguf?download=true -O llama-model.gguf | |
| RUN git clone https://github.com/ggerganov/llama.cpp | |
| RUN mv llama.cpp llama_temp | |
| RUN mv llama_temp/* . | |
| RUN make | |
| RUN apt install socat -y | |
| # Expone el puerto en el que Flask se ejecutará dentro del contenedor | |
| EXPOSE 7860 | |
| # Comando para ejecutar la aplicación Flask | |
| CMD ["sh", "-c", "./server -m /home/app/llama-model.gguf --host 0.0.0.0 --port 7860"] |