# Pakai image base Node.js 20 + Python FROM node:20-bullseye # Install Python dan dependencies penting RUN apt-get update && \ apt-get install -y --no-install-recommends \ python3 \ python3-pip \ python3-dev \ ffmpeg \ && rm -rf /var/lib/apt/lists/* # Upgrade pip dan install tools downloader RUN python3 -m pip install --upgrade pip && \ python3 -m pip install --no-cache-dir spotdl yt-dlp # Buat direktori dan set permission RUN mkdir -p /app/downloads && \ mkdir -p /app/cookies && \ chmod 777 -R /app/downloads && \ chmod 777 -R /app/cookies # Setup workdir WORKDIR /app # Install node_modules dulu buat caching COPY package*.json ./ RUN npm install # Copy semua file COPY . . # Buat file cookies default jika tidak ada RUN touch /app/cookies/youtube_cookies.txt && \ chmod 666 /app/cookies/youtube_cookies.txt # Verifikasi environment RUN echo "Versi tools:" && \ node --version && \ npm --version && \ python3 --version && \ pip --version && \ spotdl --version && \ yt-dlp --version CMD ["node", "index.js"] EXPOSE 7860