avi292423 commited on
Commit
436f6c1
·
verified ·
1 Parent(s): a18f07c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -17
Dockerfile CHANGED
@@ -1,18 +1,22 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.10-slim
3
-
4
- # Set the working directory
5
- WORKDIR /code
6
-
7
- # Copy requirements and install
8
- COPY requirements.txt .
9
- RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Copy the rest of your code
12
- COPY . .
13
-
14
- # Expose port 7860 (the default for Spaces)
15
- EXPOSE 7860
16
-
17
- # Run the FastAPI app with uvicorn
 
 
 
 
18
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory
5
+ WORKDIR /code
6
+
7
+ # Set Hugging Face cache directory to a writable location
8
+ ENV HF_HOME=/data
9
+ RUN mkdir -p /data
10
+
11
+ # Copy requirements and install
12
+ COPY requirements.txt .
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy the rest of your code
16
+ COPY . .
17
+
18
+ # Expose port 7860 (the default for Spaces)
19
+ EXPOSE 7860
20
+
21
+ # Run the FastAPI app with uvicorn
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]