eienmojiki commited on
Commit
1b6296e
·
verified ·
1 Parent(s): 14e967b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +86 -0
Dockerfile ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:12.4.1-base-ubuntu20.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive \
4
+ TZ=Asia/Ho_Chi_Minh \
5
+ PORT=7860 \
6
+ HOME=/home/user \
7
+ GO_VERSION=1.22.4
8
+
9
+ RUN useradd -m -u 1000 user
10
+
11
+ RUN apt-get update && apt-get install -y \
12
+ bash \
13
+ unzip \
14
+ git \
15
+ git-lfs \
16
+ curl \
17
+ sudo \
18
+ wget \
19
+ ffmpeg \
20
+ psmisc \
21
+ aria2 \
22
+ build-essential \
23
+ libnss3-dev \
24
+ libgdk-pixbuf2.0-dev \
25
+ libgtk-3-dev \
26
+ libxss-dev \
27
+ zlib1g-dev \
28
+ libncurses5-dev \
29
+ libssl-dev \
30
+ libreadline-dev \
31
+ libffi-dev \
32
+ libasound2 \
33
+ make \
34
+ libnss3 \
35
+ software-properties-common && \
36
+ rm -rf /var/lib/apt/lists/*
37
+
38
+ RUN wget -P /tmp "https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz" && \
39
+ tar -C /usr/local -xzf "/tmp/go${GO_VERSION}.linux-amd64.tar.gz" && \
40
+ rm "/tmp/go${GO_VERSION}.linux-amd64.tar.gz"
41
+
42
+ ENV GOPATH $HOME/go
43
+ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
44
+ RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH"
45
+
46
+ RUN curl -sL https://deb.nodesource.com/setup_20.x | bash - && \
47
+ apt-get install -y nodejs && \
48
+ npm install -g configurable-http-proxy
49
+
50
+ RUN wget https://storage.googleapis.com/chrome-for-testing-public/128.0.6613.119/linux64/chromedriver-linux64.zip && \
51
+ unzip chromedriver-linux64.zip && \
52
+ mv ./chromedriver-linux64/chromedriver /usr/bin/chromedriver && \
53
+ chown user: /usr/bin/chromedriver && \
54
+ chmod +x /usr/bin/chromedriver
55
+
56
+ RUN cd /tmp && \
57
+ wget https://www.python.org/ftp/python/3.10.12/Python-3.10.12.tgz && \
58
+ tar -xf Python-3.10.12.tgz && \
59
+ cd Python-3.10.12 && \
60
+ ./configure --enable-optimizations && \
61
+ make install && \
62
+ cd .. && \
63
+ rm -rf Python-3.10.12 Python-3.10.12.tgz
64
+
65
+ RUN add-apt-repository ppa:deadsnakes/ppa && \
66
+ add-apt-repository ppa:tomtomtom/yt-dlp && \
67
+ apt-get update && \
68
+ apt-get install -y yt-dlp
69
+
70
+ RUN cd $HOME && git clone https://github.com/marcopeocchi/yt-dlp-web-ui
71
+
72
+ WORKDIR $HOME/yt-dlp-web-ui
73
+
74
+ COPY --chown=user config.yml $HOME/yt-dlp-web-ui/config.yml
75
+ RUN mkdir -p ./archive
76
+
77
+ RUN chown -R user: $HOME/yt-dlp-web-ui
78
+ RUN cd frontend && npm i && npm run build
79
+ RUN go build -o yt-dlp-webui main.go
80
+ RUN chmod +x yt-dlp-webui
81
+
82
+ USER user
83
+
84
+ EXPOSE $PORT
85
+
86
+ CMD sh -c 'exec ./yt-dlp-webui -host "0.0.0.0" -port $PORT'