forked from TheEdgeOfRage/ytrssil
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 683 Bytes
/
Dockerfile
File metadata and controls
28 lines (20 loc) · 683 Bytes
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
FROM golang:1.25-trixie AS builder
WORKDIR /app/
ENV GOCACHE="/cache"
ENV PORT="80"
COPY go.mod go.sum /app/
RUN --mount=type=cache,target="/cache" go mod download;
COPY . /app/
RUN --mount=type=cache,target="/cache" go build -o dist/ytrssil-api cmd/main.go;
FROM debian:trixie-slim AS api
HEALTHCHECK --start-period=2s --start-interval=2s CMD exec curl -sf localhost:$PORT/healthz;
WORKDIR /app/
ENTRYPOINT ["./ytrssil-api"]
VOLUME /var/lib/ytrssil/downloads
RUN apt update \
&& apt install -y ca-certificates curl yt-dlp \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*;
COPY ./assets/ ./assets/
RUN assets/load.sh && rm assets/load.sh;
COPY --from=builder /app/dist/ ./