2024-02-17 11:09:31 -05:00
|
|
|
ARG GOLANG_VERSION="1.21.6"
|
2024-01-01 15:11:09 -05:00
|
|
|
ARG DEBIAN_VERSION="bookworm"
|
2023-04-14 11:58:32 -04:00
|
|
|
|
2024-01-01 15:11:09 -05:00
|
|
|
FROM golang:${GOLANG_VERSION}-${DEBIAN_VERSION} AS build
|
2023-08-12 13:24:26 -04:00
|
|
|
|
2023-08-14 23:11:10 -04:00
|
|
|
ENV VERSION_PKG="go.fifitido.net/ytdl-web/version"
|
2023-08-12 13:24:26 -04:00
|
|
|
ARG VERSION=latest
|
|
|
|
ARG BUILD="unknown"
|
|
|
|
ARG BUILD_DATE="unknown"
|
2023-08-14 19:26:48 -04:00
|
|
|
ARG BUILT_BY="docker"
|
2023-08-12 13:24:26 -04:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
RUN go build \
|
2023-08-16 11:45:20 -04:00
|
|
|
-ldflags=" \
|
|
|
|
-X $VERSION_PKG.Version=$VERSION \
|
|
|
|
-X $VERSION_PKG.Build=$BUILD \
|
|
|
|
-X $VERSION_PKG.BuildDate=$BUILD_DATE \
|
|
|
|
-X \"$VERSION_PKG.BuiltBy=$BUILT_BY\" \
|
|
|
|
" -o /ytdl-web .
|
2023-08-12 13:24:26 -04:00
|
|
|
|
2024-01-01 15:17:21 -05:00
|
|
|
FROM python:${DEBIAN_VERSION}
|
2023-05-23 21:59:03 -04:00
|
|
|
|
2024-05-17 20:56:38 -04:00
|
|
|
ARG YTDLP_VERSION="2024.04.09"
|
2024-01-01 15:22:58 -05:00
|
|
|
|
2023-04-14 11:58:32 -04:00
|
|
|
WORKDIR /app
|
|
|
|
|
2024-01-01 15:11:09 -05:00
|
|
|
# hadolint ignore=DL3008
|
|
|
|
RUN apt-get update \
|
|
|
|
&& apt-get install --no-install-recommends -y wget \
|
2024-01-01 15:22:58 -05:00
|
|
|
&& wget --progress=dot:giga "https://github.com/yt-dlp/yt-dlp/releases/download/${YTDLP_VERSION}/yt-dlp" \
|
2024-01-01 15:17:21 -05:00
|
|
|
&& install -pm755 yt-dlp /usr/bin/yt-dlp \
|
2024-01-01 15:11:09 -05:00
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
2023-04-14 11:58:32 -04:00
|
|
|
|
2023-08-12 13:24:26 -04:00
|
|
|
COPY --from=build /ytdl-web ./
|
2023-04-14 11:58:32 -04:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2023-05-23 21:52:00 -04:00
|
|
|
ENV YTDL_HTTP_PORT=8080 \
|
2023-05-23 22:21:07 -04:00
|
|
|
YTDL_HTTP_LISTEN=0.0.0.0 \
|
2023-07-12 19:16:28 -04:00
|
|
|
YTDL_BINARYPATH=/usr/bin/yt-dlp \
|
|
|
|
YTDL_CONFIGDIR=/config
|
2023-04-14 17:14:27 -04:00
|
|
|
|
2024-01-01 15:11:09 -05:00
|
|
|
ENTRYPOINT [ "./ytdl-web" ]
|