-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (42 loc) · 1.84 KB
/
Dockerfile
File metadata and controls
57 lines (42 loc) · 1.84 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# syntax=docker/dockerfile:1
FROM --platform=$BUILDPLATFORM node:alpine AS web-build
RUN --mount=type=cache,target=/var/cache/apk \
ln -s /var/cache/apk /etc/apk/cache && \
apk add pnpm
COPY web /web
ENV PNPM_HOME="/pnpm"
WORKDIR /web
RUN --mount=type=cache,target=${PNPM_HOME} \
pnpm config set store-dir ${PNPM_HOME} && \
pnpm install --frozen-lockfile --prefer-offline && \
pnpm install
RUN pnpm run build
FROM golang:trixie AS build
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
apt-get update && apt-get install unzip -y
COPY . /yadmb
WORKDIR /yadmb
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
RUN wget https://raw.githubusercontent.com/disgoorg/godave/refs/heads/master/scripts/libdave_install.sh && chmod +x libdave_install.sh
ENV SHELL=/bin/sh
RUN ./libdave_install.sh v1.1.0
COPY --from=web-build /web/build /yadmb/web/build
ENV PKG_CONFIG_PATH="/root/.local/lib/pkgconfig"
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
go build -trimpath -ldflags '-s -w' -o yadmb
FROM debian:trixie-slim
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
--mount=type=cache,target=/root/.cache/pip \
apt-get update && apt-get install ffmpeg python3 ca-certificates python3-pip -y --no-install-recommends && \
pip3 install --break-system-packages "yt-dlp[default,curl-cffi]" yt-dlp-ejs && \
apt-get purge -y --auto-remove python3-pip
COPY --from=ghcr.io/thetipo01/dca:latest /usr/bin/dca /usr/bin/
COPY --from=denoland/deno:bin /deno /usr/bin/
COPY --from=build /yadmb/yadmb /usr/bin/
COPY --from=build /root/.local/lib /root/.local/lib
ENV PKG_CONFIG_PATH="/root/.local/lib/pkgconfig"
CMD ["yadmb"]