-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (19 loc) · 950 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM --platform=$BUILDPLATFORM golang:1.19-alpine as build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN apk add --no-cache git ffmpeg
COPY ./ /go/src/github.com/meyskens/thomas-disco
WORKDIR /go/src/github.com/meyskens/thomas-disco
RUN export GOARM=6 && \
export GOARCH=amd64 && \
if [ "$TARGETPLATFORM" == "linux/arm64" ]; then export GOARCH=arm64; fi && \
if [ "$TARGETPLATFORM" == "linux/arm" ]; then export GOARCH=arm; fi && \
go build -ldflags "-X main.revision=$(git rev-parse --short HEAD)" ./cmd/disco/
FROM alpine:3.17
RUN apk add --no-cache curl git ffmpeg ca-certificates aria2 python3 && update-ca-certificates
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp &&\
chmod a+rx /usr/local/bin/yt-dlp
COPY --from=build /go/src/github.com/meyskens/thomas-disco/disco /usr/local/bin/
RUN mkdir /opt/disco
WORKDIR /opt/disco
CMD [ "/usr/local/bin/disco", "serve" ]