Files
ytdlp-site/Dockerfile
Carl Pearson fab6ba9216
All checks were successful
Build and Deploy ytdlp-site / build-deploy (push) Successful in 3m17s
Update build and deploy containers to trixie
2025-09-27 05:51:35 -06:00

49 lines
1.4 KiB
Docker

FROM golang:1.25.1-trixie AS builder
ARG GIT_SHA="<not provided>"
# install yt-dlp
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests wget
RUN wget -q -d https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp_linux -O /usr/local/bin/yt-dlp \
&& chmod +x /usr/local/bin/yt-dlp
# install deno
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests curl unzip
RUN curl -fsSL https://deno.land/install.sh | sh
ADD *.go /src/.
ADD config /src/config
ADD database /src/database
ADD ffmpeg /src/ffmpeg
ADD handlers /src/handlers
ADD media /src/media
ADD originals /src/originals
ADD playlists /src/playlists
ADD transcodes /src/transcodes
ADD users /src/users
ADD ytdlp /src/ytdlp
ADD go.mod /src/.
RUN cd /src && go mod tidy
RUN cd /src && go build -ldflags "-X ytdlp-site/config.gitSHA=${GIT_SHA} -X ytdlp-site/config.buildDate=$(date +%Y-%m-%d)" -o server *.go
FROM debian:trixie-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends --no-install-suggests \
ffmpeg \
&& rm -rf /var/lib/apt/lists/*
# copy yt-dlp
COPY --from=0 /usr/local/bin/yt-dlp /usr/local/bin/yt-dlp
COPY --from=0 /src/server /opt/server
# copy deno
COPY --from=0 /root/.deno /root/.deno
ENV PATH="/root/.deno/bin:$PATH"
ADD templates /opt/templates
ADD static /opt/static
WORKDIR /opt
CMD ["/opt/server"]