-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (28 loc) · 768 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (28 loc) · 768 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
29
30
31
32
33
34
35
36
37
38
# Stage 1: Build
FROM rust:1-bookworm AS builder
RUN apt-get update && apt-get install -y \
cmake \
libopus-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN cargo build --release
# Stage 2: Runtime
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y \
libopus0 \
ca-certificates \
python3 \
python3-pip \
ffmpeg \
&& pip3 install --break-system-packages yt-dlp \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd -r dirust && useradd -r -g dirust dirust
COPY --from=builder /app/target/release/dirust /usr/local/bin/dirust
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER dirust
ENV RUST_LOG=dirust=info,songbird=warn
EXPOSE 9090
ENTRYPOINT ["/entrypoint.sh"]