goldfishsoftwarelabs commited on
Commit
8b179d0
·
verified ·
1 Parent(s): e524d3c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -6
Dockerfile CHANGED
@@ -1,12 +1,19 @@
1
- FROM python:3.9-slim
 
2
 
3
- WORKDIR /app
 
 
4
 
5
- COPY requirements.txt .
6
- RUN pip install --no-cache-dir -r requirements.txt
 
7
 
8
- COPY . .
 
9
 
 
10
  EXPOSE 8000
11
 
12
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
1
+ # Use the official Ollama image as the base
2
+ FROM ollama/ollama
3
 
4
+ # Install Python and dependencies for the custom API
5
+ RUN apt-get update && apt-get install -y python3 python3-pip
6
+ RUN pip3 install fastapi uvicorn requests
7
 
8
+ # Copy a script to pull the model at container startup
9
+ COPY entrypoint.sh /entrypoint.sh
10
+ RUN chmod +x /entrypoint.sh
11
 
12
+ # Copy the FastAPI app
13
+ COPY app.py /app.py
14
 
15
+ # Expose the port for the FastAPI server
16
  EXPOSE 8000
17
 
18
+ # Run the entrypoint script and start the FastAPI server
19
+ CMD ["/entrypoint.sh"]