arifa-batool commited on
Commit
d5f0456
·
verified ·
1 Parent(s): 4d7f712

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -13
Dockerfile CHANGED
@@ -1,34 +1,25 @@
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"]
 
1
+ FROM python:3.10
 
2
 
 
3
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
 
 
6
  WORKDIR /app
7
 
8
+ # Install system dependencies
9
  RUN apt-get update && apt-get install -y \
10
  gcc \
11
  libgl1 \
12
  libglib2.0-0 \
13
  && rm -rf /var/lib/apt/lists/*
14
 
 
15
  COPY requirements.txt .
 
 
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
 
18
  COPY . .
19
 
 
20
  RUN mkdir -p static/uploads
21
 
22
+ # Hugging Face requires port 7860
23
+ EXPOSE 7860
24
 
 
25
  CMD ["python", "app.py"]