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