all repos — fixyoutube-go @ 5dec14aac005f3e3e59c9e5881d83be6729d388c

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 ./templates
15COPY invidious ./invidious
16COPY volatile ./volatile
17COPY *.go ./
18
19# Build
20RUN CGO_ENABLED=1 go build -ldflags='-s -w' -trimpath -o /dist/app
21RUN ldd /dist/app | tr -s [:blank:] '\n' | grep ^/ | xargs -I % install -D % /dist/%
22RUN ln -s ld-musl-x86_64.so.1 /dist/lib/libc.musl-x86_64.so.1
23
24# Test
25FROM build-stage AS run-test-stage
26RUN go test -v ./...
27
28FROM scratch AS build-release-stage
29
30COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
31COPY --from=builder /dist /
32
33ENTRYPOINT ["/app"]