File size: 1,103 Bytes
be610f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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