Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
-
# Use a
|
| 2 |
FROM python:3.11-slim
|
| 3 |
|
| 4 |
-
# Install
|
| 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
|
| 15 |
RUN npm install -g promptfoo
|
| 16 |
|
| 17 |
# Set working directory
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
# Copy
|
| 21 |
COPY requirements.txt .
|
| 22 |
|
| 23 |
# Install Python dependencies
|
|
|
|
|
|
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
-
# Copy
|
| 27 |
COPY . .
|
| 28 |
|
| 29 |
-
# Expose
|
| 30 |
EXPOSE 7860
|
| 31 |
|
| 32 |
-
# Run
|
| 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"]
|