Monthly update

Switch from debian to apline linux based container.
Cut down final image size by ~1GB
This commit is contained in:
2022-03-03 20:22:49 +01:00
parent b3f1377250
commit ab64a5370a
3 changed files with 13 additions and 17 deletions

View File

@@ -1,17 +1,19 @@
FROM node:16-bullseye FROM node:16-alpine3.15
RUN mkdir -p /usr/src/yt-dlp-webui/download RUN mkdir -p /usr/src/yt-dlp-webui/download
VOLUME /usr/src/yt-dlp-webui/downloads VOLUME /usr/src/yt-dlp-webui/downloads
WORKDIR /usr/src/yt-dlp-webui WORKDIR /usr/src/yt-dlp-webui
COPY package*.json ./ COPY package*.json ./
RUN apt-get update # install core dependencies
RUN apt-get install curl psmisc wget -y RUN apk update
RUN npm install RUN apk add curl wget psmisc python3 ffmpeg
RUN wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
RUN tar -xf ffmpeg-release-amd64-static.tar.xz
RUN mv ./ffmpeg-5.0-amd64-static/ff* /usr/bin
COPY . . COPY . .
RUN chmod +x ./fetch-yt-dlp.sh RUN chmod +x ./fetch-yt-dlp.sh
# install node dependencies
RUN npm install
RUN npm run build-all RUN npm run build-all
# cleanup
RUN npm remove parcel react react-dom react-bootstrap react-bootstrap-icons
RUN rm -rf .parcel-cache RUN rm -rf .parcel-cache
# expose and run
EXPOSE 3022 EXPOSE 3022
CMD [ "node" , "./dist/main.js" ] CMD [ "node" , "./dist/main.js" ]

View File

@@ -6,7 +6,7 @@ I will eventually make this better as soon as I can. Not in the immediate.
Changelog: Changelog:
``` ```
02/03/22: cut-down docker container size by using ffmpeg static builds 03/03/22: cut-down image size by switching to Alpine linux based container
01/03/22: Chinese translation by deluxghost 01/03/22: Chinese translation by deluxghost
@@ -66,7 +66,4 @@ node dist/main.js
## Todo list ## Todo list
- ~~retrieve background tasks~~ - ~~retrieve background tasks~~
- format selection - format selection
- better ui/ux - better ui/ux
_static ffmpeg builds by johnvansickle https://johnvansickle.com/ffmpeg/_

View File

@@ -1,13 +1,10 @@
#!/bin/bash #!/bin/sh
echo "Downloading latest yt-dlp build..." echo "Downloading latest yt-dlp build..."
rm -f yt-dlp rm -f yt-dlp
RELEASE=$(curl --silent "https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest" | RELEASE=$(curl --silent "https://api.github.com/repos/yt-dlp/yt-dlp/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
grep '"tag_name":' |
sed -E 's/.*"([^"]+)".*/\1/'
)
wget "https://github.com/yt-dlp/yt-dlp/releases/download/$RELEASE/yt-dlp" wget "https://github.com/yt-dlp/yt-dlp/releases/download/$RELEASE/yt-dlp"