forked from Rockbox/rockbox
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
125 lines (102 loc) · 4.33 KB
/
Copy pathDockerfile
File metadata and controls
125 lines (102 loc) · 4.33 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# ── WebUI ──────────────────────────────────────────────────────────────────────
FROM node:24 AS webui-builder
RUN apt-get update && apt-get install -y curl unzip && rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deno.land/install.sh | sh
ENV DENO_INSTALL="/root/.deno"
ENV PATH="${DENO_INSTALL}/bin:${PATH}"
WORKDIR /app/webui/rockbox
COPY webui/rockbox/package.json ./
RUN deno install --allow-scripts
COPY webui/rockbox/ ./
RUN deno task build
# ── S3 admin UI ────────────────────────────────────────────────────────────────
# Built inside the image so `docker build .` is self-contained — the repo's
# .dockerignore excludes every `dist/` directory, so the host's pre-built bundle
# never reaches the build context.
FROM oven/bun:1 AS s3-admin-builder
WORKDIR /app/crates/s3/s3webui
COPY crates/s3/s3webui/package.json crates/s3/s3webui/bun.lock ./
RUN bun install --frozen-lockfile
COPY crates/s3/s3webui/ ./
RUN bun run build
# ── Rockbox daemon ─────────────────────────────────────────────────────────────
FROM rust:1.95-trixie AS builder
ARG TARGETARCH
ARG TAG
ENV TAG=${TAG}
# Runtime deps for cpal (ALSA) and other libs
RUN apt-get update && apt-get install -y \
build-essential \
libunwind-dev \
libasound2-dev \
libdbus-1-dev \
protobuf-compiler \
curl \
wget \
zip \
unzip \
cmake
# Install Zig 0.16.0
RUN case "${TARGETARCH}" in \
amd64) ZIG_ARCH="x86_64" ;; \
arm64) ZIG_ARCH="aarch64" ;; \
*) echo "Unsupported arch: ${TARGETARCH}" && exit 1 ;; \
esac && \
export VERSION=0.16.0 && \
wget "https://ziglang.org/download/${VERSION}/zig-${ZIG_ARCH}-linux-${VERSION}.tar.xz" && \
tar -xf "zig-${ZIG_ARCH}-linux-${VERSION}.tar.xz" && \
mv "zig-${ZIG_ARCH}-linux-${VERSION}" /usr/local/zig && \
ln -s /usr/local/zig/zig /usr/local/bin/zig
COPY . /app
WORKDIR /app
COPY --from=webui-builder /app/webui/rockbox/dist/ /app/webui/rockbox/dist/
COPY --from=s3-admin-builder /app/crates/s3/s3webui/dist/ /app/crates/s3/s3webui/dist/
# Build rockboxd via the headless script (configure + make + cargo + zig)
RUN bash scripts/build-headless.sh
# Build the rockbox CLI binary
RUN cargo build -p rockbox --release
# ── Runtime image ──────────────────────────────────────────────────────────────
FROM typesense/typesense:30.1 AS typesense
FROM debian:trixie-slim
ARG TARGETARCH
ARG SNAP_VERSION=0.35.0
RUN apt-get update && apt-get install -y \
libunwind8 \
libasound2 \
libdbus-1-3 \
wget \
&& case "${TARGETARCH}" in \
amd64) SNAP_ARCH="amd64" ;; \
arm64) SNAP_ARCH="arm64" ;; \
*) echo "Unsupported arch: ${TARGETARCH}" && exit 1 ;; \
esac \
&& wget -q "https://github.com/snapcast/snapcast/releases/download/v${SNAP_VERSION}/snapserver_${SNAP_VERSION}-1_${SNAP_ARCH}_trixie.deb" -O /tmp/snapserver.deb \
&& apt-get install -y /tmp/snapserver.deb \
&& rm /tmp/snapserver.deb \
&& apt-get remove -y wget \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/zig/zig-out/bin/rockboxd /usr/local/bin/rockboxd
COPY --from=builder /app/target/release/rockbox /usr/local/bin/rockbox
COPY --from=typesense /opt/typesense-server /usr/local/bin/typesense-server
COPY docker/snapserver.conf /etc/snapserver.conf
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
RUN mkdir -p /root/.config/rockbox.org
COPY docker/settings.toml /root/.config/rockbox.org/settings.toml
RUN mkdir -p /root/Music
# rockboxd ports
EXPOSE 6061
EXPOSE 6062
EXPOSE 6063
EXPOSE 6600
# CMAF (HLS + DASH) — default audio output, played directly in the browser
EXPOSE 7882
# snapserver: client protocol, HTTP stream, HTTP JSON API
EXPOSE 1704
EXPOSE 1705
EXPOSE 1780
# navidrome
EXPOSE 4533
# jellyfin
EXPOSE 8096
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]