Video_Downloader / Dockerfile
MalikSahib1's picture
Create Dockerfile
99219be verified
# Python 3.9 base image
FROM python:3.9-slim
# Set working directory
WORKDIR /code
# Install system dependencies - ffmpeg is crucial for yt-dlp
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
# Copy requirements file
COPY ./requirements.txt /code/requirements.txt
# Install Python packages
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Copy all application code
COPY . /code/
# Expose the port Hugging Face uses
EXPOSE 7860
# Command to run the FastAPI server using Uvicorn
# The app:app refers to the 'app' object in the 'app.py' file
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]