EATosin commited on
Commit
795c2a8
·
verified ·
1 Parent(s): 49ec473

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Use Lightweight Python
2
+ FROM python:3.10-slim
3
+
4
+ # 2. Set working folder
5
+ WORKDIR /app
6
+
7
+ # 3. Create a non-root user (Hugging Face Security Requirement)
8
+ RUN useradd -m -u 1000 user
9
+ USER user
10
+ ENV PATH="/home/user/.local/bin:$PATH"
11
+
12
+ # 4. Copy and Install Dependencies
13
+ COPY --chown=user requirements.txt .
14
+ RUN pip install --no-cache-dir --upgrade pip && \
15
+ pip install --no-cache-dir -r requirements.txt
16
+
17
+ # 5. Copy the Application Code
18
+ COPY --chown=user . .
19
+
20
+ # 6. CRITICAL: Run on Port 7860
21
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]