moraxgiga commited on
Commit
6de69e5
1 Parent(s): 3a45825

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -3
Dockerfile CHANGED
@@ -1,9 +1,27 @@
 
1
  FROM python:3.10.9
2
 
3
- COPY . .
 
4
 
5
- WORKDIR /
 
 
6
 
7
- RUN pip install --no-cache-dir --upgrade -r /requirements.txt
 
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  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.9
3
 
4
+ # Set the working directory in the container to /app
5
+ WORKDIR /app
6
 
7
+ # Create a directory for Hugging Face cache and set broad permissions
8
+ RUN mkdir -p /app/hf_cache
9
+ RUN chmod -R 777 /app/hf_cache
10
 
11
+ # Set environment variable for Hugging Face home
12
+ ENV HF_HOME=/app/hf_cache
13
 
14
+ # Copy the requirements file into the container at /app
15
+ COPY ./requirements.txt /app/requirements.txt
16
+
17
+ # Install any needed packages specified in requirements.txt
18
+ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
19
+
20
+ # Copy the rest of the application into the container at /app
21
+ COPY . /app
22
+
23
+ # Make port 7860 available to the world outside this container
24
+ EXPOSE 7860
25
+
26
+ # Define the command to run the app using uvicorn
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]