# 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/* # Install Ollama server RUN curl -L https://ollama.com/download/ollama-linux-amd64.tgz -o ollama-linux-amd64.tgz && sudo tar -C /usr -xzf ollama-linux-amd64.tgz # Set working directory for the app WORKDIR /app # Create a directory for Ollama RUN mkdir -p /app/.ollama # Set environment variable for Ollama home directory ENV OLLAMA_HOME=/app/.ollama # Copy application files and model COPY . /app # Install Python dependencies RUN pip install --no-cache-dir gradio requests # Expose ports for Gradio and Ollama EXPOSE 7860 11434 # Start both services using a script COPY start_services.sh /app/start_services.sh RUN chmod +x /app/start_services.sh # Run the start_services.sh script CMD ["/app/start_services.sh"]