Abdurrehman015 commited on
Commit
29b1938
·
1 Parent(s): 0c50ff5
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Set environment variables
8
+ ENV PYTHONDONTWRITEBYTECODE=1
9
+ ENV PYTHONUNBUFFERED=1
10
+ ENV HF_TOKEN=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
11
+
12
+ # Install system dependencies
13
+ RUN apt-get update && apt-get install -y \
14
+ git \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Install Python dependencies
18
+ COPY requirements.txt .
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+
21
+ # Copy application code
22
+ COPY main.py .
23
+
24
+ # Expose port (for documentation; Spaces handles mapping)
25
+ EXPOSE 7860
26
+
27
+ # Run the application
28
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--log-level", "info"]