Update Dockerfile
Browse files- Dockerfile +9 -32
Dockerfile
CHANGED
|
@@ -1,14 +1,7 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
-
# System deps + deno (yt-dlp JS challenge solver)
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
-
ffmpeg \
|
| 6 |
-
git \
|
| 7 |
-
curl \
|
| 8 |
-
unzip \
|
| 9 |
-
libass9 \
|
| 10 |
-
libass-dev \
|
| 11 |
-
fontconfig \
|
| 12 |
&& curl -fsSL https://deno.land/install.sh | sh \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
|
@@ -17,34 +10,18 @@ ENV PATH="$DENO_INSTALL/bin:$PATH"
|
|
| 17 |
|
| 18 |
WORKDIR /app
|
| 19 |
|
| 20 |
-
#
|
| 21 |
COPY requirements.txt .
|
| 22 |
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
RUN
|
| 26 |
|
| 27 |
-
#
|
| 28 |
-
RUN mkdir -p downloads logs cookies state
|
| 29 |
-
|
| 30 |
-
# Copy application files
|
| 31 |
COPY app.py .
|
| 32 |
-
|
| 33 |
-
# Copy TikTok cookies (required)
|
| 34 |
-
COPY cookies.txt ./cookies/tiktok.txt 2>/dev/null || if [ -f cookies.txt ]; then cp cookies.txt ./cookies/tiktok.txt; fi
|
| 35 |
-
|
| 36 |
-
# Copy YouTube cookies (optional - only if file exists)
|
| 37 |
-
# Use RUN with conditional check instead of COPY with redirect
|
| 38 |
-
RUN if [ -f m_youtube_com_cookies.txt ]; then cp m_youtube_com_cookies.txt ./cookies/youtube.txt; fi
|
| 39 |
-
|
| 40 |
-
# Create start script
|
| 41 |
-
RUN echo '#!/bin/bash\n\
|
| 42 |
-
echo "🚀 Starting bot..."\n\
|
| 43 |
-
python app.py\n\
|
| 44 |
-
' > start.sh && chmod +x start.sh
|
| 45 |
-
|
| 46 |
-
# Deno version check
|
| 47 |
-
RUN deno --version && yt-dlp --version
|
| 48 |
|
| 49 |
EXPOSE 7860
|
| 50 |
-
|
|
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 4 |
+
ffmpeg git curl unzip \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
&& curl -fsSL https://deno.land/install.sh | sh \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
|
|
|
| 10 |
|
| 11 |
WORKDIR /app
|
| 12 |
|
| 13 |
+
# Copy requirements first (for caching)
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
+
RUN pip install --no-cache-dir -U yt-dlp
|
| 17 |
|
| 18 |
+
# Create directories
|
| 19 |
+
RUN mkdir -p downloads logs
|
| 20 |
|
| 21 |
+
# Copy all files (simple)
|
|
|
|
|
|
|
|
|
|
| 22 |
COPY app.py .
|
| 23 |
+
COPY cookies.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
CMD ["python", "app.py"]
|