thehammadishaq commited on
Commit
bf2f6ca
·
verified ·
1 Parent(s): 2c285b8

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -0
Dockerfile ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.10 or later
2
+ FROM python:3.10
3
+
4
+ # Set the working directory
5
+ WORKDIR /app
6
+
7
+ # Set Hugging Face cache directory
8
+ ENV HF_HOME=/huggingface
9
+ ENV TRANSFORMERS_CACHE=/huggingface/cache
10
+
11
+ # Ensure cache directory exists
12
+ RUN mkdir -p /huggingface/cache
13
+
14
+ # Copy files
15
+ COPY requirements.txt app.py ./
16
+
17
+ # Install dependencies and store cache
18
+ RUN pip install -r requirements.txt
19
+
20
+ # Expose port for FastAPI
21
+ EXPOSE 7860
22
+
23
+ # Run FastAPI app
24
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]