2023-04-15 00:08:30 -04:00
|
|
|
ARG GO_VERSION="1.20"
|
|
|
|
ARG ALPINE_VERSION="3.17"
|
|
|
|
|
|
|
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as builder
|
2023-04-14 11:58:32 -04:00
|
|
|
|
|
|
|
WORKDIR /usr/src/ytdl-web
|
|
|
|
|
2023-04-14 12:01:06 -04:00
|
|
|
COPY . .
|
2023-04-14 11:58:32 -04:00
|
|
|
|
2023-04-15 00:02:44 -04:00
|
|
|
RUN go install github.com/go-task/task/v3/cmd/task@latest \
|
2023-04-15 17:28:18 -04:00
|
|
|
&& apk add --no-cache git \
|
2023-04-15 00:02:44 -04:00
|
|
|
&& task deps \
|
|
|
|
&& task build
|
2023-04-14 11:58:32 -04:00
|
|
|
|
|
|
|
|
2023-04-15 00:08:30 -04:00
|
|
|
FROM alpine:${ALPINE_VERSION}
|
2023-04-14 11:58:32 -04:00
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-04-15 17:28:18 -04:00
|
|
|
RUN apk add --no-cache yt-dlp ffmpeg
|
2023-04-14 11:58:32 -04:00
|
|
|
|
2023-04-15 15:43:04 -04:00
|
|
|
COPY --from=builder /usr/src/ytdl-web/out/ytdl-web ./ytdl-web
|
2023-04-14 11:58:32 -04:00
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
2023-04-15 17:28:18 -04:00
|
|
|
ENV YTDL_PORT=8080 \
|
2023-04-14 17:14:27 -04:00
|
|
|
YTDL_LISTEN=0.0.0.0
|
|
|
|
|
2023-04-15 17:28:18 -04:00
|
|
|
ENTRYPOINT [ "./ytdl-web" ]
|