Spaces:
Build error
Build error
| # Use the official Ollama image as the base | |
| FROM ollama/ollama | |
| # Install Python and dependencies for the custom API | |
| RUN apt-get update && apt-get install -y python3 python3-pip | |
| RUN pip3 install fastapi uvicorn requests | |
| # Create a directory for persistent storage (Hugging Face Spaces uses /data) | |
| RUN mkdir -p /data/.ollama && ln -s /data/.ollama /root/.ollama | |
| # Copy the entrypoint script | |
| COPY entrypoint.sh /entrypoint.sh | |
| RUN chmod +x /entrypoint.sh | |
| # Copy the FastAPI app | |
| COPY app.py /app.py | |
| # Expose the port for the FastAPI server (Hugging Face Spaces uses 8000) | |
| EXPOSE 8000 | |
| # Run the entrypoint script using a shell | |
| CMD ["/bin/bash", "/entrypoint.sh"] |