Spaces:
Running
Running
File size: 834 Bytes
389a715 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# Use Python 3.11 (Stable for AI libraries)
FROM python:3.11-slim
# Set the working directory inside the container
WORKDIR /app
# Install system dependencies required for OpenCV
# (Even 'headless' OpenCV sometimes needs these basic libs)
RUN apt-get update && apt-get install -y \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (to cache dependencies)
COPY requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application code
COPY . .
# Expose the port your app runs on
EXPOSE 5000
# Command to run the app using Gunicorn (Production server)
# "app:app" means "look in app.py for the 'app' variable"
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--timeout", "120", "app:app"] |