CCI_OLLAMA_CODE_CHAT / Dockerfile
jeanmarcocruz207's picture
Upload 29 files
3754f8b verified
raw
history blame contribute delete
978 Bytes
FROM python:3.11-slim
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
ca-certificates \
build-essential \
git \
nodejs \
npm \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://ollama.com/install.sh | sh
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY frontend/package.json frontend/package-lock.json ./frontend/
RUN cd frontend && npm install
COPY start.sh ./start.sh
RUN chmod +x start.sh
COPY . .
RUN cd frontend && npm run build
# Configurar variables de entorno para Ollama y HF Spaces
ENV OLLAMA_HOST=0.0.0.0
ENV OLLAMA_ORIGINS=*
ENV PORT=7860
ENV LLAMA_DEV_OLLAMA_URL=http://127.0.0.1:11434
# Crear directorio para modelos de Ollama
RUN mkdir -p /root/.ollama
EXPOSE 7860
EXPOSE 11434
# Usar exec form para mejor manejo de señales
CMD ["/bin/bash", "/app/start.sh"]