captiongenrater / Dockerfile
deedrop1140's picture
Upload 13 files
21dd635 verified
raw
history blame contribute delete
578 Bytes
# Use a lightweight Python image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Copy requirements first for caching
COPY requirements.txt .
# Install system dependencies (needed for OpenCV, rembg, etc.)
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1 libglib2.0-0 \
&& pip install --no-cache-dir -r requirements.txt \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the app code
COPY . .
# Expose Flask port (must match app.py → 7860)
EXPOSE 7860
# Run Flask app
CMD ["python", "app.py"]