Spaces:
Sleeping
Sleeping
updated dockerfile for quantized
Browse files- Dockerfile +17 -20
Dockerfile
CHANGED
|
@@ -1,38 +1,35 @@
|
|
| 1 |
-
# Use official Python 3.11 image
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
|
|
|
|
|
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
# Set working directory
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
# Set Hugging Face
|
| 13 |
-
# This helps with model downloads and caching within the Space
|
| 14 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 15 |
-
HF_HOME=/app/.cache
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
# ✅ Ensure ChromaDB can write its persistent database
|
| 19 |
-
# This directory will hold the DB built at runtime.
|
| 20 |
-
# It MUST be a consistent, writable location for persistence.
|
| 21 |
-
RUN mkdir -p /app/vector_database && chmod -R 777 /app/vector_database
|
| 22 |
|
| 23 |
-
|
| 24 |
-
|
| 25 |
|
| 26 |
# Install Python dependencies
|
|
|
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
-
# Copy
|
| 30 |
-
# Assuming 'app' and 'processed_chunks.json' are at the root level of your project
|
| 31 |
COPY . .
|
| 32 |
|
| 33 |
-
# Expose the port
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
#
|
| 37 |
-
|
| 38 |
-
CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use official Python 3.11 base image
|
| 2 |
FROM python:3.11
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
+
cmake \
|
| 8 |
+
git \
|
| 9 |
+
curl \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Set working directory
|
| 13 |
WORKDIR /app
|
| 14 |
|
| 15 |
+
# Set Hugging Face and ChromaDB cache directories
|
|
|
|
| 16 |
ENV TRANSFORMERS_CACHE=/app/.cache \
|
| 17 |
+
HF_HOME=/app/.cache \
|
| 18 |
+
PYTHONUNBUFFERED=1 \
|
| 19 |
+
PERSIST_DIR=/app/vector_database
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
|
| 22 |
+
RUN mkdir -p ${PERSIST_DIR} && chmod -R 777 ${PERSIST_DIR}
|
| 23 |
|
| 24 |
# Install Python dependencies
|
| 25 |
+
COPY requirements.txt .
|
| 26 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
+
# Copy project code
|
|
|
|
| 29 |
COPY . .
|
| 30 |
|
| 31 |
+
# Expose the port FastAPI will run on
|
| 32 |
EXPOSE 7860
|
| 33 |
|
| 34 |
+
# Run the FastAPI app using uvicorn
|
| 35 |
+
CMD ["uvicorn", "app.app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|