Skip to content

Commit 852aef6

Browse files
committed
🐛 Possible youtube-dl docker cache issue
1 parent bd3e238 commit 852aef6

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

packages/server/src/Dockerfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ FROM node:18-alpine AS builder
44
WORKDIR /app
55

66
# 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
816

917
# Copy package files first to leverage cache
1018
COPY package.json yarn.lock ./
@@ -24,8 +32,15 @@ FROM node:18-alpine
2432

2533
WORKDIR /app
2634

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
2944

3045
# Copy only necessary files from builder
3146
COPY --from=builder /app/package.json /app/yarn.lock ./

0 commit comments

Comments
 (0)