WaysAheadGlobal commited on
Commit
f4391df
·
verified ·
1 Parent(s): 80a11b1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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 persistent vector store directory and set permissions
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 English model
34
  RUN python -m spacy download en_core_web_sm
35
 
36
- # Copy application code
37
  COPY . .
38
 
39
  # Expose FastAPI port
40
  EXPOSE 7860
41
 
42
- # Run the app (assumes your app entry file is `app.py`)
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"]