Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +6 -5
Dockerfile
CHANGED
|
@@ -4,6 +4,7 @@ FROM python:3.10-slim
|
|
| 4 |
# Set environment variables
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
|
|
|
| 7 |
|
| 8 |
# Set working directory
|
| 9 |
WORKDIR /app
|
|
@@ -23,21 +24,21 @@ RUN apt-get update && apt-get install -y \
|
|
| 23 |
curl \
|
| 24 |
&& rm -rf /var/lib/apt/lists/*
|
| 25 |
|
| 26 |
-
# Create
|
| 27 |
-
RUN mkdir -p /app/persistent_vector_store && chmod -R 777 /app
|
| 28 |
|
| 29 |
# Copy and install Python dependencies
|
| 30 |
COPY requirements.txt .
|
| 31 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 32 |
|
| 33 |
-
# Download spaCy
|
| 34 |
RUN python -m spacy download en_core_web_sm
|
| 35 |
|
| 36 |
-
# Copy
|
| 37 |
COPY . .
|
| 38 |
|
| 39 |
# Expose FastAPI port
|
| 40 |
EXPOSE 7860
|
| 41 |
|
| 42 |
-
#
|
| 43 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 4 |
# Set environment variables
|
| 5 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
+
ENV DEEPFACE_HOME=/app/.deepface
|
| 8 |
|
| 9 |
# Set working directory
|
| 10 |
WORKDIR /app
|
|
|
|
| 24 |
curl \
|
| 25 |
&& rm -rf /var/lib/apt/lists/*
|
| 26 |
|
| 27 |
+
# Create writable directories
|
| 28 |
+
RUN mkdir -p /app/.deepface /app/persistent_vector_store && chmod -R 777 /app
|
| 29 |
|
| 30 |
# Copy and install Python dependencies
|
| 31 |
COPY requirements.txt .
|
| 32 |
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 33 |
|
| 34 |
+
# Download spaCy model
|
| 35 |
RUN python -m spacy download en_core_web_sm
|
| 36 |
|
| 37 |
+
# Copy app files
|
| 38 |
COPY . .
|
| 39 |
|
| 40 |
# Expose FastAPI port
|
| 41 |
EXPOSE 7860
|
| 42 |
|
| 43 |
+
# Start the app (ensure your file is named app.py and contains app = FastAPI())
|
| 44 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|