-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (35 loc) · 1.29 KB
/
Dockerfile
File metadata and controls
46 lines (35 loc) · 1.29 KB
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
37
38
39
40
41
42
43
44
45
46
# Use the official Python image
FROM python:3.11-slim
# Set the working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
wget \
gcc \
libpq-dev \
libffi-dev \
libssl-dev \
libmagic-dev \
&& rm -rf /var/lib/apt/lists/*
# Clone the PhiData repository and checkout the specific commit
RUN git clone https://github.com/phidatahq/phidata.git && \
cd phidata && \
git checkout c7baaf1a0cd4546c0a124924bfcc9150f391da5f
# Navigate to the Ollama RAG directory
WORKDIR /app/phidata/cookbook/llms/ollama/rag
# Copy the requirements.txt file
COPY requirements.txt .
# Install required Python packages
RUN pip install --no-cache-dir -r requirements.txt
# Set environment variables
ENV DATABASE_URL=postgresql://ai:ai@db:5432/ai
# Create application_materials directory and download the provided PDF
RUN mkdir -p /app/application_materials/knowledge_files && \
wget -O /app/application_materials/knowledge_files/sample.pdf https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf
# Copy the modified app.py that uses the OllamaEmbedder
COPY app.py .
# Expose the port for Streamlit
EXPOSE 8501
# Command to run the application
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]