Yousuf-Islam commited on
Commit
a8344ac
·
verified ·
1 Parent(s): d2204f4

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9
2
+
3
+ WORKDIR /code
4
+
5
+ # Install requirements
6
+ COPY ./requirements.txt /code/requirements.txt
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ # Copy all files (model + app code) to the container
10
+ COPY . /code
11
+
12
+ # Create a cache directory to prevent permission errors
13
+ RUN mkdir -p /code/cache
14
+ ENV TRANSFORMERS_CACHE=/code/cache
15
+ RUN chmod -R 777 /code/cache
16
+
17
+ # Start the API on port 7860
18
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]