Akash297 commited on
Commit
4a0eae0
·
verified ·
1 Parent(s): 6e1714c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -25
Dockerfile CHANGED
@@ -1,25 +1,22 @@
1
- # Use an official Python image as a base
2
- FROM python:3.10-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Install required dependencies
8
- RUN apt-get update && apt-get install -y curl && \
9
- curl -fsSL https://ollama.com/install.sh | sh && \
10
- apt-get clean && rm -rf /var/lib/apt/lists/*
11
-
12
- # Copy the application files
13
- COPY . /app
14
-
15
- # Install Python dependencies
16
- RUN pip install --no-cache-dir flask gunicorn
17
-
18
- # Download the Ollama model on startup
19
- RUN ollama pull llama3.2
20
-
21
- # Expose the required port
22
- EXPOSE 7860
23
-
24
- # Start Ollama service and Flask app
25
- CMD ollama serve & gunicorn -w 2 -b 0.0.0.0:7860 flask_ollama_llama3:app
 
1
+ # Use an official Python image as a base
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install required dependencies
8
+ RUN apt-get update && apt-get install -y curl && \
9
+ curl -fsSL https://ollama.com/install.sh | sh && \
10
+ apt-get clean && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Copy the application files
13
+ COPY . /app
14
+
15
+ # Install Python dependencies
16
+ RUN pip install --no-cache-dir flask gunicorn
17
+
18
+ # Expose the required port
19
+ EXPOSE 7860
20
+
21
+ # Start Ollama and the Flask app
22
+ CMD bash -c "ollama pull llama3.2 && ollama serve & gunicorn -w 2 -b 0.0.0.0:7860 flask_ollama_llama3:app"