Spaces:
Running
Running
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' |