# Use an official Python runtime as a parent image | |
FROM python:3.9-slim | |
# Set the working directory in the container | |
WORKDIR /usr/src/app | |
COPY ./requirements.txt /code/requirements.txt | |
COPY . . | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Install curl | |
RUN apt-get update && \ | |
apt-get install -y curl && \ | |
rm -rf /var/lib/apt/lists/* | |
# Download and execute the installation script | |
RUN curl -fsSL https://ollama.com/install.sh | sh | |
# Copy the local directory contents into the container at /usr/src/app | |
COPY . . | |
# Make sure main.py is executable | |
RUN chmod +x main.py | |
# Run main.py when the container launches | |
CMD ["python", "./main.py"] |