ytdl-web/Dockerfile

29 lines
511 B
Docker

ARG GO_VERSION="1.20"
ARG ALPINE_VERSION="3.17"
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as builder
WORKDIR /usr/src/ytdl-web
COPY . .
RUN go install github.com/go-task/task/v3/cmd/task@latest \
&& apk add --no-cache git \
&& task deps \
&& task build
FROM alpine:${ALPINE_VERSION}
WORKDIR /app
RUN apk add --no-cache yt-dlp ffmpeg
COPY --from=builder /usr/src/ytdl-web/out/ytdl-web ./ytdl-web
EXPOSE 8080
ENV YTDL_PORT=8080 \
YTDL_LISTEN=0.0.0.0
ENTRYPOINT [ "./ytdl-web" ]