Entz commited on
Commit
1a5c031
·
verified ·
1 Parent(s): ebb82af

Upload dockerfile

Browse files
Files changed (1) hide show
  1. dockerfile +27 -0
dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file
8
+ COPY requirements.txt .
9
+
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Install Ollama
14
+ RUN apt-get update && apt-get install -y curl
15
+ RUN curl -fsSL https://ollama.com/install.sh | sh
16
+
17
+ # Pre-download the llama3.2:1b model and debug
18
+ RUN ollama pull llama3.2:1b && ollama list
19
+
20
+ # Copy the app code
21
+ COPY app.py .
22
+
23
+ # Expose the Streamlit port
24
+ EXPOSE 8501
25
+
26
+ # Start Ollama in the background, log output, wait 10 seconds, then run Streamlit
27
+ CMD ollama serve > ollama.log 2>&1 & sleep 10 && streamlit run app.py --server.port 8501 --server.address 0.0.0.0