# Base image for Python FROM python:3.10-slim # Install dependencies for Ollama #RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/* RUN apk update && apk add wget build-base python3-dev musl-dev linux-headers RUN CMAKE_ARGS="-DLLAMA_BLAS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS" pip install llama-cpp-python # Install Ollama server # Set working directory for the app RUN mkdir app COPY . /app RUN chmod -R 777 /app WORKDIR /app # Install Ollama #RUN curl https://ollama.ai/install.sh | sh # Create the directory and give appropriate permissions #RUN mkdir -p /.ollama && chmod 777 /.ollama # Ensure Ollama binary is in the PATH #ENV PATH="/app/venv/bin:/root/.ollama/bin:$PATH" # Copy application files and model COPY . /app # Install Python dependencies RUN mkdir -p /.cache/huggingface/hub -m 777 RUN mkdir -p /.config/matplotlib -m 777 RUN chmod -R 777 /.cache RUN chmod -R 777 /.config # Updating pip and installing everything from requirements RUN python3 -m pip install -U pip setuptools wheel # Run the start_services.sh script CMD ["python","app.py"]