NaseefNazrul commited on
Commit
0a70d2f
·
verified ·
1 Parent(s): 5ee657c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -0
Dockerfile ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for Hugging Face Spaces (FastAPI)
2
+ FROM python:3.9
3
+
4
+ # create unprivileged user per HF recommendations
5
+ RUN useradd -m -u 1000 user
6
+ USER user
7
+ ENV PATH="/home/user/.local/bin:$PATH"
8
+
9
+ WORKDIR /app
10
+
11
+ # copy and install requirements
12
+ COPY --chown=user ./requirements.txt requirements.txt
13
+ RUN pip install --no-cache-dir --upgrade -r requirements.txt
14
+
15
+ # copy app files
16
+ COPY --chown=user . /app
17
+
18
+ # run uvicorn on port 7860 (HF expects this port)
19
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]