Spaces:
Runtime error
Runtime error
File size: 922 Bytes
ff9773c |
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 27 28 29 30 31 32 33 34 35 36 |
FROM ubuntu:22.04
# Set the working directory in the container
WORKDIR /app
# Install system dependencies and Python
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
curl \
&& rm -rf /var/lib/apt/lists/*
# Set Python3 as the default
RUN ln -s /usr/bin/python3 /usr/bin/python
# Install Ollama
RUN curl -fsSL https://ollama.com/install.sh | bash
# Ensure Ollama is in the system path
ENV PATH="/root/.ollama/bin:$PATH"
# Pre-download the Llama3 model to avoid downloading it at runtime
RUN ollama serve & sleep 5 && ollama pull mannix/defog-llama3-sqlcoder-8b
# Copy the requirements file and install dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application files
COPY . .
# Expose the FastAPI default port
EXPOSE 8000
# Start Ollama and FastAPI
CMD ["sh", "-c", "ollama serve & uvicorn main:app --host 0.0.0.0 --port 8000"] |