TubeScript-API/Dockerfile.api

28 lines
680 B
Docker

# Dockerfile para la API (FastAPI) con yt-dlp y ffmpeg
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1
# Instalar ffmpeg y herramientas necesarias
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg \
curl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copiar requirements y instalar dependencias
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir yt-dlp
# Copiar el resto del código
COPY . /app
EXPOSE 8000
# Comando por defecto para ejecutar la API
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]