File size: 710 Bytes
f35e5d4 5337a1e 83f8192 5337a1e f35e5d4 5337a1e f35e5d4 5337a1e f35e5d4 5337a1e f35e5d4 5337a1e 590afda 5337a1e |
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 |
FROM python:3.9
# Install ollama tool
RUN apt-get update && apt-get install -y \
curl \
&& curl -fsSL https://ollama.com/install.sh | sh \
&& apt-get clean
# Create user
RUN useradd -m -u 1000 user
# Set the working directory
WORKDIR /app
# Install dependencies
COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Copy the rest of the application code
COPY --chown=user . /app
# Pull the model
RUN python -c "import subprocess; subprocess.run(['ollama', 'pull', 'mohamedo/bignova'], check=True)"
# Expose port for FastAPI
EXPOSE 8000
# Start FastAPI app
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|