2023-08-12 13:24:26 -04:00
|
|
|
ARG GOLANG_VERSION="1.20.5"
|
2023-07-12 19:22:33 -04:00
|
|
|
ARG ALPINE_VERSION="3.18"
|
2023-04-14 11:58:32 -04:00
|
|
|
|
2023-08-12 13:24:26 -04:00
|
|
|
FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS build
|
|
|
|
|
|
|
|
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 \
|
|
|
|
-ldflags="-X $VERSION_PKG.Version=${VERSION}" \
|
|
|
|
-ldflags="-X $VERSION_PKG.Build=${BUILD}" \
|
|
|
|
-ldflags="-X $VERSION_PKG.BuildDate=${BUILD_DATE}" \
|
2023-08-14 19:26:48 -04:00
|
|
|
-ldflags="-X $VERSION_PKG.BuiltBy=${BUILT_BY}" \
|
2023-08-12 13:24:26 -04:00
|
|
|
-o /ytdl-web .
|
|
|
|
|
2023-05-23 22:21:07 -04:00
|
|
|
FROM alpine:${ALPINE_VERSION}
|
2023-05-23 21:59:03 -04:00
|
|
|
|
2023-04-14 11:58:32 -04:00
|
|
|
WORKDIR /app
|
|
|
|
|
2023-07-12 20:23:06 -04:00
|
|
|
ARG YTDLP_VERSION="2023.07.06-r0"
|
|
|
|
RUN apk add --no-cache yt-dlp==${YTDLP_VERSION}
|
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
|
|
|
|
2023-04-15 17:28:18 -04:00
|
|
|
ENTRYPOINT [ "./ytdl-web" ]
|