FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y \ curl ca-certificates python3 python3-pip bash && \ rm -rf /var/lib/apt/lists/* # Install Ollama RUN curl -fsSL https://ollama.com/install.sh | sh WORKDIR /app COPY requirements.txt /app/requirements.txt RUN pip3 install --no-cache-dir -r /app/requirements.txt COPY app.py /app/app.py COPY start.sh /app/start.sh RUN chmod +x /app/start.sh # Ollama listens on localhost by default; set host explicitly ENV OLLAMA_HOST=0.0.0.0:11434 # For Gradio on Spaces ENV GRADIO_SERVER_NAME=0.0.0.0 ENV GRADIO_SERVER_PORT=7860 CMD ["/app/start.sh"]