File size: 1,961 Bytes
7d5c977
1b6296e
 
 
 
 
 
 
 
 
fd42b39
 
1b6296e
fd42b39
 
 
1b6296e
fd42b39
 
 
 
 
 
 
 
 
1b6296e
fd42b39
4c70c05
 
1b6296e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8776cb0
1b6296e
 
 
 
 
 
 
 
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
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 rm -f /etc/apt/sources.list.d/*.list && \
    apt-get update && apt-get install -y --no-install-recommends \
    curl \
    ca-certificates \
    sudo \
    git \
    wget \
    procps \
    git-lfs \
    zip \
    unzip \
    htop \
    vim \
    nano \
    bzip2 \
    libx11-6 \
    build-essential \
    libsndfile-dev \
    software-properties-common && \
    rm -rf /var/lib/apt/lists/*

RUN wget -P /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" && \
    tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz" && \
    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 | bash - && \
    apt-get install -y nodejs && \
    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 && \
    mv ./chromedriver-linux64/chromedriver /usr/bin/chromedriver && \
    chown user: /usr/bin/chromedriver && \
    chmod +x /usr/bin/chromedriver

RUN add-apt-repository ppa:deadsnakes/ppa && \
    add-apt-repository ppa:tomtomtom/yt-dlp && \
    apt-get update && \
    apt-get 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 --legacy-peer-deps && npm run build
RUN go build -o yt-dlp-webui main.go
RUN chmod +x yt-dlp-webui

USER user

EXPOSE $PORT

CMD sh -c 'exec ./yt-dlp-webui -host "0.0.0.0" -port $PORT'