diff --git a/.dockerignore b/.dockerignore index dc69752..acfeba9 100644 --- a/.dockerignore +++ b/.dockerignore @@ -11,4 +11,5 @@ src/server/core/yt-dlp .env *.mp4 *.ytdl -*.db \ No newline at end of file +*.db +build/ \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8a804c8..0f5b409 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,6 @@ src/server/core/yt-dlp *.part *.db downloads -.DS_Store \ No newline at end of file +.DS_Store +build/ +yt-dlp-webui diff --git a/Dockerfile b/Dockerfile index 5ce79e7..b987779 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,20 @@ -FROM node:18-alpine -RUN mkdir -p /usr/src/yt-dlp-webui/download +FROM alpine:3.17 +# folder structure +WORKDIR /usr/src/yt-dlp-webui/downloads VOLUME /usr/src/yt-dlp-webui/downloads WORKDIR /usr/src/yt-dlp-webui -COPY package*.json ./ # install core dependencies RUN apk update -RUN apk add curl wget psmisc python3 ffmpeg +RUN apk add curl wget psmisc python3 ffmpeg nodejs go yt-dlp +# copy srcs COPY . . -RUN chmod +x ./fetch-yt-dlp.sh # install node dependencies +WORKDIR /usr/src/yt-dlp-webui/frontend RUN npm i RUN npm run build -RUN npm run build-server -RUN npm run fetch +# install go dependencies +WORKDIR /usr/src/yt-dlp-webui +RUN npm go build -o yt-dlp-webui # expose and run -EXPOSE 3022 -CMD [ "node" , "./dist/main.js" ] +EXPOSE 3033 +CMD [ "yt-dlp-webui" , "--out", "./downloads" ] diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..882764c --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +default: + go build -o yt-dlp-webui main.go + +all: + cd frontend && pnpm build && cd .. + go build -o yt-dlp-webui main.go + +multiarch: + GOOS=linux GOARCH=arm go build -o yt-dlp-webui_linux-arm *.go + GOOS=linux GOARCH=arm64 go build -o yt-dlp-webui_linux-arm64 *.go + GOOS=linux GOARCH=amd64 go build -o yt-dlp-webui_linux-amd64 *.go + mkdir -p build + mv yt-dlp-webui* build + +clean: + rm -rf build \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 5ff2e1e..c657b3f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -10,7 +10,7 @@
- +