Ezhil commited on
Commit
09e24e5
·
1 Parent(s): 359f62a

Changes in Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -4
Dockerfile CHANGED
@@ -4,17 +4,23 @@ FROM python:3.10
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
- # Copy the requirements file
8
- COPY requirements.txt .
 
 
 
 
 
9
 
10
- # Install dependencies
 
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
  # Copy the application code
14
  COPY . .
15
 
16
  # Expose the FastAPI default port
17
- EXPOSE 7860
18
 
19
  # Run FastAPI with Uvicorn
20
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
4
  # Set the working directory
5
  WORKDIR /app
6
 
7
+ # Set environment variables for HF cache
8
+ ENV HF_HOME="/app/cache"
9
+ ENV TRANSFORMERS_CACHE="/app/cache"
10
+ ENV SENTENCE_TRANSFORMERS_HOME="/app/cache"
11
+
12
+ # Create the cache directory with appropriate permissions
13
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
14
 
15
+ # Copy the requirements file and install dependencies
16
+ COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
  # Copy the application code
20
  COPY . .
21
 
22
  # Expose the FastAPI default port
23
+ EXPOSE 7860
24
 
25
  # Run FastAPI with Uvicorn
26
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]