starkbyte45896 commited on
Commit
91967e7
·
verified ·
1 Parent(s): 6865ee3

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +35 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python image
2
+ FROM python:3.9-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+ ENV PORT=7860
8
+
9
+ # Install system dependencies (OpenCV needs them)
10
+ RUN apt-get update && apt-get install -y \
11
+ build-essential \
12
+ libglib2.0-0 \
13
+ libsm6 \
14
+ libxext6 \
15
+ libxrender-dev \
16
+ ffmpeg \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Create working directory
20
+ WORKDIR /app
21
+
22
+ # Copy dependencies file first (better Docker caching)
23
+ COPY requirement.txt .
24
+
25
+ # Install Python dependencies
26
+ RUN pip install --upgrade pip && pip install -r requirement.txt
27
+
28
+ # Copy all project files
29
+ COPY . .
30
+
31
+ # Expose port for Hugging Face Spaces
32
+ EXPOSE $PORT
33
+
34
+ # Run your app
35
+ CMD ["python", "app.py"]