Spaces:
Runtime error
Runtime error
File size: 743 Bytes
a8fe4dc ff9773c 1498adf ff9773c 1498adf 65969bc 1498adf ff9773c 1498adf ff9773c 1498adf a8fe4dc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
FROM python:3.11-slim as base
WORKDIR /app
# Install system tools including curl and pkill (from procps package)
RUN apt-get update && apt-get install -y curl procps && rm -rf /var/lib/apt/lists/*
# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | bash
ENV PATH="/root/.ollama/bin:$PATH"
# Start Ollama to pull model, then stop it
RUN ollama serve & sleep 5 && ollama pull mannix/defog-llama3-sqlcoder-8b:latest && echo "Done. Stop Ollama..." && pkill ollama
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app source code
COPY . .
EXPOSE 8000
# Start Ollama and FastAPI app
CMD ["sh", "-c", "ollama serve & uvicorn app.main:app --host 0.0.0.0 --port 8000"]
|