logeswari commited on
Commit
caf5c7a
·
1 Parent(s): a99c4cb
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -1,20 +1,22 @@
1
- # Use official Python image
2
  FROM python:3.9
3
 
4
- # Set the working directory inside the container
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 files
14
- COPY . .
15
 
16
- # Expose the FastAPI port
17
  EXPOSE 7860
18
 
19
- # Run the FastAPI app with Uvicorn
20
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
 
3
  WORKDIR /app
4
+ COPY . /app
5
 
6
+ ENV HF_HOME=/app/.cache
 
7
 
8
+ RUN mkdir -p /app/.cache/huggingface/hub && \
9
+ chmod -R 777 /app/.cache && \
10
+ chmod -R 777 /app/.cache/huggingface
11
+
12
+
13
+
14
+ RUN pip install --upgrade pip
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ COPY --chown=user ./requirements.txt requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
19
 
 
20
  EXPOSE 7860
21
 
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]