File size: 699 Bytes
c3c6f00 | 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 | FROM python:3.9-slim
# Install system dependencies (ffmpeg and openh264 dependencies for OpenCV)
RUN apt-get update && apt-get install -y \
ffmpeg \
libsm6 \
libxext6 \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install python dependencies before copying code to cache layers
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create necessary directories
RUN mkdir -p data/uploads data/outputs
# Copy the source code
COPY . .
# Expose the API port
EXPOSE 8001
# Command to run the application (Render injects $PORT automatically)
CMD uvicorn api:app --host 0.0.0.0 --port ${PORT:-8001}
|