Spaces:
Runtime error
Runtime error
AI-RESEARCHER-2024
commited on
Commit
•
84f58ef
1
Parent(s):
41541aa
Update Dockerfile
Browse files- Dockerfile +29 -19
Dockerfile
CHANGED
@@ -1,25 +1,35 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
# Install
|
4 |
-
RUN apt-get update && apt-get install -y
|
5 |
-
|
6 |
-
|
7 |
-
|
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.
|
18 |
|
19 |
-
|
|
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
|
24 |
-
#
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|