Spaces:
Running
Running
Echo-ai
commited on
Update Dockerfile
Browse files- Dockerfile +25 -6
Dockerfile
CHANGED
@@ -1,6 +1,25 @@
|
|
1 |
-
FROM python:3.9
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
# Install curl and Ollama
|
4 |
+
RUN apt-get update && apt-get install -y curl && \
|
5 |
+
curl -fsSL https://ollama.ai/install.sh | sh && \
|
6 |
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
7 |
+
|
8 |
+
# Set up user and environment
|
9 |
+
RUN useradd -m -u 1000 user
|
10 |
+
USER user
|
11 |
+
ENV HOME=/home/user PATH="/home/user/.local/bin:$PATH"
|
12 |
+
WORKDIR $HOME/app
|
13 |
+
|
14 |
+
# Copy and install Python dependencies
|
15 |
+
COPY --chown=user requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the rest of the app
|
19 |
+
COPY --chown=user . .
|
20 |
+
|
21 |
+
# Make the start script executable
|
22 |
+
RUN chmod +x start.sh
|
23 |
+
|
24 |
+
# Start Ollama and the app
|
25 |
+
CMD ["./start.sh"]
|