ShabazKnowde commited on
Commit
2a0a592
·
verified ·
1 Parent(s): 6f2e602

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +20 -0
Dockerfile ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python 3.10.9 image
2
+ FROM python:3.10.9
3
+
4
+ # Create a directory for the cache with write permissions
5
+ RUN mkdir /cache && chmod 777 /cache
6
+
7
+ # Copy the current directory contents into the container at .
8
+ COPY . .
9
+
10
+ # Set the working directory to /
11
+ WORKDIR /
12
+
13
+ # Set the TRANSFORMERS_CACHE environment variable to the created cache directory
14
+ ENV TRANSFORMERS_CACHE=/cache
15
+
16
+ # Install requirements.txt
17
+ RUN pip install --no-cache-dir --upgrade -r /requirements.txt
18
+
19
+ # Start the FastAPI app on port 7860, the default port expected by Spaces
20
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7880"]