nurfarah57 commited on
Commit
037f003
·
verified ·
1 Parent(s): 679fd42

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -0
Dockerfile ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python image
2
+ FROM python:3.10
3
+
4
+ # Set environment variables
5
+ ENV TRANSFORMERS_CACHE=/data/.cache
6
+ ENV HF_HOME=/data/.cache
7
+
8
+ # Install dependencies
9
+ RUN pip install --upgrade pip
10
+ RUN pip install fastapi uvicorn transformers torch
11
+
12
+ # Create app directory
13
+ WORKDIR /app
14
+
15
+ # Copy code
16
+ COPY main.py .
17
+
18
+ # Expose port
19
+ EXPOSE 7860
20
+
21
+ # Start FastAPI
22
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]