redfernstech commited on
Commit
4976e48
·
verified ·
1 Parent(s): 09225e0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -13
Dockerfile CHANGED
@@ -1,13 +1,29 @@
1
- FROM python:3.12.5
2
-
3
- RUN useradd -m -u 1000 user
4
- USER user
5
- ENV PATH="/home/user/.local/bin:$PATH"
6
-
7
- WORKDIR /app
8
-
9
- COPY --chown=user ./requirements.txt requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
-
12
- COPY --chown=user . /app
13
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use official Python base image
2
+ FROM python:3.12.5
3
+
4
+ # Create a new user and switch to it
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:$PATH"
8
+
9
+ # Set working directory
10
+ WORKDIR /app
11
+
12
+ # Copy and install dependencies
13
+ COPY --chown=user ./requirements.txt requirements.txt
14
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
+
16
+ # Install Ollama
17
+ RUN curl -fsSL https://ollama.com/install.sh | sh
18
+
19
+ # Pull the Llama3 model (or any other model you need)
20
+ RUN ollama pull llama3:8b
21
+
22
+ # Copy application code
23
+ COPY --chown=user . /app
24
+
25
+ # Expose FastAPI default port
26
+ EXPOSE 7860
27
+
28
+ # Run the FastAPI app
29
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]