sql-lite-chat / Dockerfile
redfernstech's picture
Update Dockerfile
1498adf verified
raw
history blame
743 Bytes
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"]