Parent directory

Dockerfile

702 bytes
 1FROM golang:1.27-alpine AS builder
 2
 3WORKDIR /app/
 4ENV GOCACHE="/cache"
 5ENV PORT="80"
 6
 7COPY go.mod go.sum /app/
 8RUN --mount=type=cache,target="/cache" go mod download;
 9
10COPY . /app/
11RUN --mount=type=cache,target="/cache" CGO_ENABLED=0 go build -o dist/ytrssil-api cmd/main.go;
12
13FROM jauderho/yt-dlp:2026.08.19@sha256:23f3e78185f729646c6a585d82f630f7472b59712c008fe797239ba708ce9668 AS api
14
15RUN apk add --no-cache curl
16HEALTHCHECK --start-period=2s --start-interval=2s CMD exec curl -sf localhost:$PORT/healthz;
17WORKDIR /app/
18ENTRYPOINT ["dumb-init", "./ytrssil-api"]
19VOLUME /var/lib/ytrssil/downloads
20
21COPY ./assets/ ./assets/
22RUN assets/load.sh && rm assets/load.sh;
23
24COPY --from=builder /app/dist/ ./