-
Notifications
You must be signed in to change notification settings - Fork 291
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (31 loc) · 1023 Bytes
/
Dockerfile
File metadata and controls
39 lines (31 loc) · 1023 Bytes
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
#
# youtube-dl-server Dockerfile
#
# https://github.com/manbearwiz/youtube-dl-server-dockerfile
#
FROM python:alpine
# Install JS runtime for yt-dlp based on architecture
# deno is available on: x86_64 (amd64), aarch64 (arm64)
# nodejs fallback for: armv7, armhf, armv6, armel and other architectures
RUN apk add --no-cache ffmpeg tzdata && \
ARCH=$(apk --print-arch) && \
case "$ARCH" in \
x86_64|aarch64) \
apk add --no-cache deno \
;; \
*) \
apk add --no-cache nodejs && \
mkdir -p /etc/yt-dlp && \
echo "--js-runtimes node" > /etc/yt-dlp/config \
;; \
esac
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY requirements.txt /usr/src/app/
RUN apk --update-cache add --virtual build-dependencies gcc libc-dev make \
&& pip install --no-cache-dir -r requirements.txt \
&& apk del build-dependencies
COPY . /usr/src/app
EXPOSE 8080
VOLUME ["/youtube-dl", "/root/.config/yt-dlp"]
CMD ["uvicorn", "youtube-dl-server:app", "--host", "0.0.0.0", "--port", "8080"]