viskav commited on
Commit
ece6626
·
verified ·
1 Parent(s): 5c58237

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +1 -20
Dockerfile CHANGED
@@ -1,31 +1,12 @@
1
- # Use a slim Python image for a smaller container size
2
  FROM python:3.11-slim
3
 
4
- # Install system dependencies needed for llama-cpp-python to build
5
- # This includes gcc, g++, and cmake
6
- USER root
7
- RUN apt-get update && apt-get install -y --no-install-recommends \
8
- gcc \
9
- g++ \
10
- cmake \
11
- && apt-get clean \
12
- && rm -rf /var/lib/apt/lists/*
13
-
14
- # Set the working directory
15
  WORKDIR /app
16
 
17
- # Copy and install Python dependencies
18
  COPY requirements.txt .
19
- # Install llama-cpp-python, which builds llama.cpp from source
20
- # --no-cache-dir helps keep the image size down
21
  RUN pip install --no-cache-dir -r requirements.txt
22
 
23
- # Copy the application code
24
  COPY app.py .
25
 
26
- # Hugging Face Spaces Docker SDK default port
27
  EXPOSE 7860
28
 
29
- # Define the command to run the FastAPI application
30
- # app:app refers to the 'app' FastAPI object in 'app.py'
31
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
 
5
  COPY requirements.txt .
 
 
6
  RUN pip install --no-cache-dir -r requirements.txt
7
 
 
8
  COPY app.py .
9
 
 
10
  EXPOSE 7860
11
 
12
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]