hariharan220 commited on
Commit
d503ebd
Β·
verified Β·
1 Parent(s): 5f83530

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -6
Dockerfile CHANGED
@@ -1,21 +1,25 @@
1
  # βœ… Use an official lightweight Python image
2
  FROM python:3.10-slim
3
 
4
- # βœ… Set environment variables to prevent Python from writing .pyc files
5
- ENV PYTHONUNBUFFERED=1
 
6
 
7
- # βœ… Set working directory inside the container
8
  WORKDIR /app
9
 
10
- # βœ… Copy the required files
11
  COPY requirements.txt .
12
  COPY app.py .
13
 
14
  # βœ… Install dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
- # βœ… Expose the FastAPI port
 
 
 
18
  EXPOSE 7860
19
 
20
- # βœ… Command to run FastAPI when the container starts
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # βœ… Use an official lightweight Python image
2
  FROM python:3.10-slim
3
 
4
+ # βœ… Set environment variables
5
+ ENV TRANSFORMERS_CACHE=/app/cache
6
+ ENV HF_HOME=/app/cache
7
 
8
+ # βœ… Set working directory
9
  WORKDIR /app
10
 
11
+ # βœ… Copy files
12
  COPY requirements.txt .
13
  COPY app.py .
14
 
15
  # βœ… Install dependencies
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # βœ… Create cache folder & set permissions
19
+ RUN mkdir -p /app/cache && chmod -R 777 /app/cache
20
+
21
+ # βœ… Expose FastAPI port
22
  EXPOSE 7860
23
 
24
+ # βœ… Run FastAPI
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]