chaithanyashaji commited on
Commit
6a1ded3
·
verified ·
1 Parent(s): b75f7a8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -7
Dockerfile CHANGED
@@ -1,23 +1,29 @@
1
  # Base image
 
2
  FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy project files
8
  COPY . .
9
 
10
- # Install system dependencies
11
- RUN apt-get update && apt-get install -y libfaiss-dev && rm -rf /var/lib/apt/lists/*
 
 
12
 
13
  # Install Python dependencies
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- ENV TRANSFORMERS_CACHE=/app/cache
 
 
 
 
 
17
  # Expose the application port
18
  EXPOSE 8000
19
 
20
  # Run the application
21
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
22
-
23
-
 
1
  # Base image
2
+ # Use the Python 3.10 slim base image
3
  FROM python:3.10-slim
4
 
5
+ # Set the working directory
6
  WORKDIR /app
7
 
8
+ # Copy project files into the container
9
  COPY . .
10
 
11
+ # Install system dependencies (including FAISS)
12
+ RUN apt-get update && \
13
+ apt-get install -y libfaiss-dev && \
14
+ rm -rf /var/lib/apt/lists/*
15
 
16
  # Install Python dependencies
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Set the cache directory for Hugging Face models
20
+ ENV HF_HOME=/app/cache
21
+
22
+ # Ensure the cache directory exists and is writable
23
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
24
+
25
  # Expose the application port
26
  EXPOSE 8000
27
 
28
  # Run the application
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]