File size: 966 Bytes
855fcc7 | 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 | FROM python:3.10
WORKDIR /app
# Copy just the Deno binary from the official image - cleanest method
COPY --from=denoland/deno:bin /deno /usr/local/bin/deno
# Install ffmpeg only (no Node.js needed anymore)
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && \
apt-get clean && rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 appuser
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir --pre -r requirements.txt && \
pip install --no-cache-dir --upgrade "yt-dlp[default]"
# [default] pulls in yt-dlp-ejs automatically
# Set Deno cache dir to a writable location for non-root user
ENV DENO_DIR=/app/.deno_cache
ENV DENO_NO_UPDATE_CHECK=1
COPY . .
RUN find /app -type d -exec chmod 755 {} \; && \
find /app -type f -exec chmod 644 {} \; && \
chown -R appuser:appuser /app
USER appuser
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |