arifa-batool commited on
Commit
ffd6bf4
·
verified ·
1 Parent(s): 7949f3c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -0
Dockerfile ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a lightweight Python base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set working directory inside container
9
+ WORKDIR /app
10
+
11
+ # Install system dependencies (required for Pillow & TensorFlow)
12
+ RUN apt-get update && apt-get install -y \
13
+ gcc \
14
+ libgl1 \
15
+ libglib2.0-0 \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Copy requirements first (for layer caching)
19
+ COPY requirements.txt .
20
+
21
+ # Install Python dependencies
22
+ RUN pip install --no-cache-dir -r requirements.txt
23
+
24
+ # Copy the entire project
25
+ COPY . .
26
+
27
+ # Create uploads directory (safety)
28
+ RUN mkdir -p static/uploads
29
+
30
+ # Expose Flask port
31
+ EXPOSE 8080
32
+
33
+ # Run the Flask app
34
+ CMD ["python", "app.py"]