PoppaYAO commited on
Commit
03e3e8c
·
verified ·
1 Parent(s): e58f496

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -10
Dockerfile CHANGED
@@ -1,33 +1,33 @@
1
- # Use a slim Python base
2
  FROM python:3.11-slim
3
 
4
- # Install system dependencies (build tools, cmake for llama.cpp, nodejs for promptfoo)
5
  RUN apt-get update && apt-get install -y \
6
- build-essential \
7
- cmake \
8
- git \
9
  curl \
 
10
  nodejs \
11
  npm \
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
- # Install promptfoo globally (our security testing tool)
15
  RUN npm install -g promptfoo
16
 
17
  # Set working directory
18
  WORKDIR /app
19
 
20
- # Copy Python requirements first (better caching)
21
  COPY requirements.txt .
22
 
23
  # Install Python dependencies
 
 
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
- # Copy the rest of the application
27
  COPY . .
28
 
29
- # Expose the port Hugging Face uses
30
  EXPOSE 7860
31
 
32
- # Run the server
33
  CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a Python image that has many tools pre-installed
2
  FROM python:3.11-slim
3
 
4
+ # Install Node.js (needed for promptfoo) and system tools
5
  RUN apt-get update && apt-get install -y \
 
 
 
6
  curl \
7
+ git \
8
  nodejs \
9
  npm \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Install promptfoo globally
13
  RUN npm install -g promptfoo
14
 
15
  # Set working directory
16
  WORKDIR /app
17
 
18
+ # Copy requirements
19
  COPY requirements.txt .
20
 
21
  # Install Python dependencies
22
+ # We use --extra-index-url to get the pre-built 'wheel' to avoid compilation timeout
23
+ RUN pip install --no-cache-dir --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu llama-cpp-python
24
  RUN pip install --no-cache-dir -r requirements.txt
25
 
26
+ # Copy application code
27
  COPY . .
28
 
29
+ # Expose port
30
  EXPOSE 7860
31
 
32
+ # Run server
33
  CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]