File size: 2,388 Bytes
7f82030
 
 
 
6b97789
 
9eb6062
7f82030
 
 
 
 
 
 
 
 
 
 
 
 
b2dd330
7f82030
 
 
 
 
 
 
 
 
 
 
 
d12a803
7f82030
 
8a9bb33
 
 
 
 
b2dd330
7f82030
 
 
 
 
 
 
 
 
 
 
 
 
8a9bb33
7f82030
 
 
 
 
 
 
 
 
 
 
 
 
d12a803
7f82030
 
 
 
 
 
2b8b1b0
 
 
 
7f82030
 
 
 
 
 
22d2ef0
7f82030
afdb999
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
FROM buildpack-deps:22.04-curl

ENV DEBIAN_FRONTEND=noninteractive \
    TZ=Asia/Ho_Chi_Minh \
    PORT=7860 \
    HOME=/home/user \
    GO_VERSION=1.22.4

RUN useradd -m -u 1000 user

RUN apt-get update && apt-get install -y --no-install-recommends \
    bash \
    unzip \
    git \
    git-lfs \
    curl \
    sudo \
    wget \
    ffmpeg \
    psmisc \
    aria2 \
    build-essential
RUN rm -rf /var/lib/apt/lists/*

RUN wget -P /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz"
RUN tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
RUN rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"

ENV GOPATH $HOME/go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"

RUN curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash - && \
    apt install nodejs -y && \
    npm install -g configurable-http-proxy

RUN wget https://storage.googleapis.com/chrome-for-testing-public/128.0.6613.119/linux64/chromedriver-linux64.zip && \
    unzip chromedriver-linux64.zip && \
    sudo mv ./chromedriver-linux64/chromedriver /usr/bin/chromedriver && \
    sudo chown user: /usr/bin/chromedriver && \
    sudo chmod +x /usr/bin/chromedriver

RUN sudo apt install -y \
    libnss3-dev \
    libgdk-pixbuf2.0-dev \
    libgtk-3-dev \
    libxss-dev \
    zlib1g-dev \
    libncurses5-dev \
    libssl-dev \
    libreadline-dev \
    libffi-dev \
    libasound2 \
    make \
    libnss3
RUN sudo apt update -y

RUN cd /tmp && \
    wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz && \
    tar -xf Python-3.10.12.tgz && \
    cd Python-3.10.12 && \
    ./configure --enable-optimizations && \
    sudo make install
RUN rm -fr /tmp/Python-3.10.12 && \
    rm /tmp/Python-3.10.12.tgz

RUN sudo apt install -y software-properties-common && \
    sudo add-apt-repository ppa:deadsnakes/ppa && \
    sudo add-apt-repository ppa:tomtomtom/yt-dlp && \
    sudo apt update -y && \
    sudo apt install -y yt-dlp

RUN cd $HOME && git clone https://github.com/marcopeocchi/yt-dlp-web-ui

WORKDIR $HOME/yt-dlp-web-ui

COPY --chown=user config.yml $HOME/yt-dlp-web-ui/config.yml
RUN mkdir -p ./archive

RUN chown -R user: $HOME/yt-dlp-web-ui
RUN cd frontend && npm i && npm run build
RUN go build -o yt-dlp-webui main.go
RUN chmod +x yt-dlp-webui

USER user

EXPOSE $PORT

CMD ./yt-dlp-webui -port $PORT