all repos — fixyoutube-go @ 5dacd81acbedefff9ee292127e188e1052e7e540

A better way to embed YouTube videos everywhere (inspired by FixTweet).

Dockerfile (view raw)

 1# syntax=docker/dockerfile:1
 2
 3FROM golang:alpine AS builder
 4
 5RUN apk add --no-cache build-base
 6
 7WORKDIR /build
 8
 9# Download Go modules
10COPY go.mod go.sum ./
11RUN go mod download
12
13# Transfer source code
14COPY templates /dist/templates
15COPY templates ./templates
16COPY invidious ./invidious
17COPY volatile ./volatile
18COPY *.go ./
19
20# Build
21RUN CGO_ENABLED=1 go build -ldflags='-s -w' -trimpath -o /dist/app
22RUN ldd /dist/app | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % /dist/%
23RUN ln -s ld-musl-x86_64.so.1 /dist/lib/libc.musl-x86_64.so.1
24
25# Test
26FROM build-stage AS run-test-stage
27RUN go test -v ./...
28
29FROM scratch AS build-release-stage
30
31COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
32COPY --from=builder /dist /
33
34ENTRYPOINT ["/app"]