@@ -4,7 +4,15 @@ FROM node:18-alpine AS builder
4
4
WORKDIR /app
5
5
6
6
# Install build dependencies
7
- RUN apk add --no-cache python3 make g++
7
+ RUN apk add --no-cache python3 make g++ curl
8
+
9
+ # Create directory for youtube-dl binary and download it
10
+ RUN mkdir -p /usr/local/bin && \
11
+ curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \
12
+ chmod a+rx /usr/local/bin/yt-dlp
13
+
14
+ # Set environment variable to skip youtube-dl-exec postinstall
15
+ ENV YOUTUBE_DL_SKIP_DOWNLOAD=true
8
16
9
17
# Copy package files first to leverage cache
10
18
COPY package.json yarn.lock ./
@@ -24,8 +32,15 @@ FROM node:18-alpine
24
32
25
33
WORKDIR /app
26
34
27
- # Install production-only dependencies
28
- RUN apk add --no-cache python3
35
+ # Install production dependencies
36
+ RUN apk add --no-cache python3 curl
37
+
38
+ # Copy youtube-dl binary from builder
39
+ COPY --from=builder /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp
40
+ RUN chmod a+rx /usr/local/bin/yt-dlp
41
+
42
+ # Set environment variable to skip youtube-dl-exec postinstall
43
+ ENV YOUTUBE_DL_SKIP_DOWNLOAD=true
29
44
30
45
# Copy only necessary files from builder
31
46
COPY --from=builder /app/package.json /app/yarn.lock ./
0 commit comments