reviewed dockerfile

This commit is contained in:
2023-01-20 19:39:09 +01:00
parent 0c737b2a3e
commit 570b9eb2da
3 changed files with 23 additions and 13 deletions

View File

@@ -1,20 +1,29 @@
FROM alpine:3.17
# Multi stage build Dockerfile
# There's no point in using the edge (development branch of alpine)
FROM alpine:3.17 AS build
# folder structure
WORKDIR /usr/src/yt-dlp-webui/downloads
VOLUME /downloads
WORKDIR /usr/src/yt-dlp-webui
# install core dependencies
RUN apk update
RUN apk add curl wget psmisc ffmpeg nodejs npm go yt-dlp
# copy srcs
RUN apk update && \
apk add curl wget psmisc ffmpeg nodejs yarn go yt-dlp
# copia la salsa
COPY . .
# install node dependencies
# build frontend
WORKDIR /usr/src/yt-dlp-webui/frontend
RUN npm i
RUN npm run build
# install go dependencies
RUN yarn install && \
yarn build
# build backend + incubator
WORKDIR /usr/src/yt-dlp-webui
RUN go build -o yt-dlp-webui
# expose and run
FROM alpine:3.17
WORKDIR /usr/src/yt-dlp-webui/downloads
VOLUME /downloads
COPY --from=build /usr/src/yt-dlp-webui /usr/bin/yt-dlp-webui
EXPOSE 3033
CMD [ "./yt-dlp-webui" , "--out", "/downloads" ]
CMD [ "/usr/bin/yt-dlp-webui" , "--out", "/downloads" ]