2023-09-11 23:28:15 +02:00
|
|
|
FROM golang:1.19.13-alpine3.18 AS builder
|
|
|
|
|
|
|
|
WORKDIR /build
|
|
|
|
|
|
|
|
COPY ./ /build
|
|
|
|
|
|
|
|
RUN sed -i 's/1.21.0/1.21/g' /build/go.mod
|
|
|
|
RUN go mod edit -go=1.19
|
|
|
|
|
|
|
|
RUN go build -o viddl .
|
|
|
|
|
|
|
|
FROM alpine:3.18
|
|
|
|
|
2023-09-11 23:57:40 +02:00
|
|
|
RUN apk add --no-cache yt-dlp
|
|
|
|
|
2023-09-11 23:28:15 +02:00
|
|
|
COPY --from=builder /build/viddl /app/viddl
|
|
|
|
|
|
|
|
RUN chmod +x /app/viddl
|
|
|
|
|
2023-09-13 15:46:46 +02:00
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3\
|
|
|
|
CMD curl -f http://localhost:8080 || exit 1
|
|
|
|
|
2023-09-11 23:28:15 +02:00
|
|
|
CMD [ "/app/viddl" ]
|