Adi362 commited on
Commit
4f3a7db
·
verified ·
1 Parent(s): 46e79cb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -17
Dockerfile CHANGED
@@ -1,31 +1,15 @@
1
- # Use an official lightweight Python image
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory in the container
5
  WORKDIR /app
6
 
7
- # Install build tools needed for llama-cpp-python
8
- RUN apt-get update && apt-get install -y \
9
- build-essential \
10
- cmake \
11
- && rm -rf /var/lib/apt/lists/*
12
-
13
- # Copy the requirements file into the container
14
  COPY requirements.txt .
15
 
16
- # Install the Python dependencies
17
- RUN pip install --no-cache-dir -r requirements.txt
18
 
19
- # Copy the application code into the container
20
  COPY . .
21
 
22
- # Hugging Face Spaces run as user 1000.
23
- # We need to make sure the app directory is writable so the
24
- # huggingface_hub can download and cache the GGUF model in ./models
25
  RUN mkdir -p /app/models && chmod -R 777 /app
26
 
27
- # Expose the correct port for Hugging Face Spaces
28
  EXPOSE 7860
29
 
30
- # Command to start the FastAPI application
31
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
 
 
 
 
 
 
 
5
  COPY requirements.txt .
6
 
7
+ RUN pip install --no-cache-dir -r requirements.txt --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
 
8
 
 
9
  COPY . .
10
 
 
 
 
11
  RUN mkdir -p /app/models && chmod -R 777 /app
12
 
 
13
  EXPOSE 7860
14
 
 
15
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]