redfernstech commited on
Commit
a2220c9
·
verified ·
1 Parent(s): cc67a7f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -4,6 +4,9 @@ FROM ubuntu:22.04
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
 
 
 
7
  # Install system dependencies and Python
8
  RUN apt-get update && apt-get install -y \
9
  python3 \
@@ -36,5 +39,5 @@ COPY . .
36
  # Expose the FastAPI default port
37
  EXPOSE 8000
38
 
39
- # Start Ollama, pull Llama3 if not present, then start FastAPI
40
- CMD ["sh", "-c", "ollama serve & sleep 5 && ollama pull llama3 && uvicorn main:app --host 0.0.0.0 --port 8000"]
 
4
  # Set the working directory in the container
5
  WORKDIR /app
6
 
7
+ # Ensure we are running as root
8
+ USER root
9
+
10
  # Install system dependencies and Python
11
  RUN apt-get update && apt-get install -y \
12
  python3 \
 
39
  # Expose the FastAPI default port
40
  EXPOSE 8000
41
 
42
+ # Start Ollama and FastAPI as root
43
+ CMD ["sh", "-c", "export OLLAMA_HOME=/app/.ollama && ollama serve & sleep 5 && ollama pull llama3 && uvicorn main:app --host 0.0.0.0 --port 8000"]