MASSJ77 commited on
Commit
95699c8
·
verified ·
1 Parent(s): 411c593

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use lightweight Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Prevent Python from buffering logs
5
+ ENV PYTHONUNBUFFERED=1
6
+ ENV PYTHONDONTWRITEBYTECODE=1
7
+
8
+ # Install system dependencies (needed for OpenCV + PIL)
9
+ RUN apt-get update && apt-get install -y \
10
+ git \
11
+ curl \
12
+ libglib2.0-0 \
13
+ libgl1 \
14
+ libsm6 \
15
+ libxext6 \
16
+ libxrender1 \
17
+ ffmpeg \
18
+ && rm -rf /var/lib/apt/lists/*
19
+
20
+ # Set working directory
21
+ WORKDIR /app
22
+
23
+ # Copy requirements first (better caching)
24
+ COPY requirements.txt .
25
+
26
+ # Upgrade pip + install dependencies
27
+ RUN pip install --no-cache-dir --upgrade pip && \
28
+ pip install --no-cache-dir -r requirements.txt
29
+
30
+ # Copy app files
31
+ COPY . .
32
+
33
+ # Expose port (HF uses 7860)
34
+ EXPOSE 7860
35
+
36
+ # Start FastAPI server
37
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]