Update dockerfile to use args

This commit is contained in:
Evan Fiordeliso 2023-04-15 00:08:30 -04:00
parent 76cdf0ae3a
commit 2f1f742899
1 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,9 @@
FROM golang:1.20-alpine3.17 as builder ARG GO_VERSION="1.20"
ARG ALPINE_VERSION="3.17"
ARG YTDLP_VERSION="2023.03.04"
ARG FFMPEG_VERSION="5.1.3"
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} as builder
WORKDIR /usr/src/ytdl-web WORKDIR /usr/src/ytdl-web
@ -9,11 +14,11 @@ RUN go install github.com/go-task/task/v3/cmd/task@latest \
&& task build && task build
FROM alpine:3.17 FROM alpine:${ALPINE_VERSION}
WORKDIR /app WORKDIR /app
RUN apk add --no-cache yt-dlp==2023.03.04 ffmpeg==5.1.3 RUN "apk add --no-cache yt-dlp==${YTDLP_VERSION} ffmpeg==${FFMPEG_VERSION}"
COPY --from=builder /usr/src/ytdl-web/ytdl-web ./ytdl-web COPY --from=builder /usr/src/ytdl-web/ytdl-web ./ytdl-web