-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (40 loc) · 1.15 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (40 loc) · 1.15 KB
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
49
50
51
FROM python:3.12-slim
WORKDIR /app
# System dependencies
# streamrip often needs libsndfile1 and build tools for some dependencies
# locales are often needed for python packages that handle metadata
RUN apt-get update && apt-get install -y \
ffmpeg \
curl \
git \
libsndfile1 \
build-essential \
locales \
pipx \
&& rm -rf /var/lib/apt/lists/*
# Set locale
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LANG=en_US.UTF-8
ENV LANGUAGE=en_US:en
ENV LC_ALL=en_US.UTF-8
ENV PATH="/root/.local/bin:${PATH}"
# Upgrade pip
RUN pip install --no-cache-dir --upgrade pip
# Python deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# yt-dlp
RUN pip install --no-cache-dir yt-dlp
# streamrip via pipx for better isolation on Linux
RUN pipx install streamrip
# Copy app files
COPY server.py .
COPY index.html .
COPY static/ ./static/
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN mkdir -p downloads/singles downloads/playlists data/logs
EXPOSE 8081
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["python", "server.py"]