fugthchat commited on
Commit
4bcdfab
·
verified ·
1 Parent(s): 462067d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -11
Dockerfile CHANGED
@@ -1,19 +1,32 @@
1
- # Use Python 3.10 base
2
  FROM python:3.10-slim
3
 
4
- # Install system dependencies
5
- RUN apt-get update && apt-get install -y wget build-essential && rm -rf /var/lib/apt/lists/*
6
 
7
- # Install Python packages
8
- COPY requirements.txt /app/requirements.txt
 
 
 
 
 
 
9
  WORKDIR /app
10
- RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Pre-download smallest model to make build faster
13
- RUN wget -O stablelm-zephyr-3b.Q3_K_S.gguf https://huggingface.co/TheBloke/stablelm-zephyr-3b-GGUF/resolve/main/stablelm-zephyr-3b.Q3_K_S.gguf || true
14
 
15
- # Copy app code
16
- COPY . /app
 
17
 
 
 
 
 
18
  EXPOSE 7860
19
- CMD ["python", "app.py"]
 
 
 
 
1
+ # Start from a basic Python 3.10 image
2
  FROM python:3.10-slim
3
 
4
+ # Set frontend to noninteractive to avoid prompts
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # Install system dependencies needed to *build* llama-cpp-python
8
+ # This fixes compile errors.
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ cmake \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Set the working directory inside the container
15
  WORKDIR /app
 
16
 
17
+ # Copy the requirements file first
18
+ COPY ./requirements.txt /app/requirements.txt
19
 
20
+ # Install Python packages
21
+ RUN pip install --no-cache-dir --upgrade pip
22
+ RUN pip install --no-cache-dir -r /app/requirements.txt
23
 
24
+ # Copy the main application file
25
+ COPY ./app.py /app/app.py
26
+
27
+ # Expose the port that FastAPI (uvicorn) will run on
28
  EXPOSE 7860
29
+
30
+ # Command to run the application
31
+ # This starts app.py, which will THEN download the model.
32
+ CMD ["python", "app.py"]