# Use an official Python runtime as a base image | |
FROM python:3.10-slim | |
# Set the working directory in the container | |
WORKDIR /app | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
curl \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install Ollama (you may need to adjust the installation method depending on the source) | |
RUN curl -o ollama-installer.sh https://ollama.com/download.sh && \ | |
chmod +x ollama-installer.sh && \ | |
./ollama-installer.sh | |
# Install Python dependencies (Streamlit and langchain_ollama) | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Copy the application code to the container | |
COPY . . | |
# Expose port 8501 for Streamlit | |
EXPOSE 8501 | |
# Command to run the app | |
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] | |