mobadara commited on
Commit
cd7be5c
·
verified ·
1 Parent(s): 11dfce2

Sync from GitHub via hub-sync

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -0
Dockerfile ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.9-slim
3
+
4
+ # Set up a new user named "user" with user ID 1000
5
+ # This is a strict requirement for Hugging Face Spaces
6
+ RUN useradd -m -u 1000 user
7
+ USER user
8
+
9
+ # Set environment variables for the user
10
+ ENV HOME=/home/user \
11
+ PATH=/home/user/.local/bin:$PATH
12
+
13
+ WORKDIR $HOME/app
14
+
15
+ # Copy requirements and install them
16
+ COPY --chown=user requirements.txt .
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy the rest of your application code
20
+ COPY --chown=user . .
21
+
22
+ # Run Uvicorn on port 7860 (The port HF Spaces listens to)
23
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]