Skip to content

Commit 3affce6

Browse files
committed
✨ feat: Add Dockerfile and docker-compose.yml for Streamlit application
Created a Dockerfile with commands to set up the environment, install dependencies, copy files, expose port 8501, and run the Streamlit application. Also added a docker-compose.yml file to define a service named "app" with volume mapping, port forwarding, and an environment variable setting OLLAMA_BASE_URL to http://host.docker.internal:11434.
1 parent 7c53e3f commit 3affce6

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM python:3.11-slim
2+
3+
WORKDIR /app
4+
5+
# Install system dependencies
6+
RUN apt-get update && apt-get install -y \
7+
build-essential \
8+
&& rm -rf /var/lib/apt/lists/*
9+
10+
# Copy requirements first to leverage Docker cache
11+
COPY requirements.txt .
12+
RUN pip install --no-cache-dir -r requirements.txt
13+
14+
# Copy application code
15+
COPY . .
16+
17+
# Expose the port Streamlit runs on
18+
EXPOSE 8501
19+
20+
# Command to run the application
21+
CMD ["streamlit", "run", "rag.py", "--server.address", "0.0.0.0"]

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: '3.8'
2+
3+
services:
4+
app:
5+
build: .
6+
ports:
7+
- "8501:8501"
8+
volumes:
9+
- .:/app
10+
environment:
11+
- OLLAMA_BASE_URL=http://host.docker.internal:11434
12+

0 commit comments

Comments
 (0)