arcsu1 commited on
Commit
a0d7418
·
1 Parent(s): c828826
Files changed (1) hide show
  1. Dockerfile +12 -7
Dockerfile CHANGED
@@ -1,14 +1,19 @@
1
  FROM python:3.10.12
2
 
3
- # Copy the current directory contents into the container at .
4
- COPY . .
5
 
6
- # Set the working directory to /
7
- WORKDIR /
8
 
9
- # Install requirements.txt
10
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
 
 
 
 
 
 
11
 
12
  # Start the FastAPI app on port 7860, the default port expected by Spaces
13
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
14
-
 
1
  FROM python:3.10.12
2
 
3
+ # Set the working directory in the container
4
+ WORKDIR /app
5
 
6
+ # Set the environment variable for the Hugging Face cache
7
+ ENV TRANSFORMERS_CACHE=/app/.cache
8
 
9
+ # Copy the current directory contents into the container at /app
10
+ COPY . /app
11
+
12
+ # Install the Python dependencies from requirements.txt
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Create the cache directory with appropriate permissions
16
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
17
 
18
  # Start the FastAPI app on port 7860, the default port expected by Spaces
19
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]