AI-RESEARCHER-2024 commited on
Commit
84f58ef
1 Parent(s): 41541aa

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -19
Dockerfile CHANGED
@@ -1,25 +1,35 @@
1
- FROM python:3.10
 
2
 
3
- # Install necessary packages
4
- RUN apt-get update && apt-get install -y curl
5
-
6
- # Set the working directory
7
- WORKDIR /app
8
-
9
- # Copy application files and requirements
10
- COPY . /app
11
- COPY ./requirements.txt /app/requirements.txt
12
-
13
- # Install Python dependencies
14
- RUN pip install -r requirements.txt
15
 
16
  # Install Ollama
17
- RUN curl -fsSL https://ollama.com/install.sh | sh
18
 
19
- COPY . .
 
20
 
21
- # Start Ollama server in the background and pull the required model
22
- # CMD ["sudo","python", "ollama_serve.py", "llama3.2"]
23
 
24
- # Set the command to run the Chainlit application
25
- CMD ["chainlit", "run", "app.py", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
 
4
+ # Install system dependencies
5
+ RUN apt-get update && apt-get install -y \
6
+ build-essential \
7
+ curl \
8
+ && rm -rf /var/lib/apt/lists/*
 
 
 
 
 
 
 
9
 
10
  # Install Ollama
11
+ RUN curl -fsSL https://ollama.ai/install.sh | sh
12
 
13
+ # Set working directory
14
+ WORKDIR /app
15
 
16
+ # Copy the current directory contents into the container
17
+ COPY . .
18
 
19
+ # Install Python dependencies
20
+ RUN pip install --no-cache-dir \
21
+ chainlit \
22
+ langchain \
23
+ chromadb \
24
+ pydantic \
25
+ typing-extensions
26
+
27
+ # Make port 8000 available to the world outside this container
28
+ EXPOSE 8000
29
+
30
+ # Create a script to start both Ollama and the Chainlit app
31
+ RUN echo '#!/bin/bash\nollama serve &\nsleep 5\nollama pull llama3.2\nollama pull llama3.2\nchainlit run app.py --host 0.0.0.0 --port 8000' > start.sh
32
+ RUN chmod +x start.sh
33
+
34
+ # Run the script when the container launches
35
+ CMD ["./start.sh"]