forked from carlreid/StreamMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.base
73 lines (62 loc) · 2.57 KB
/
Dockerfile.base
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
# Set the base image for the ASP.NET Core application
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base
# Define build-time arguments for platform and architecture
ARG TARGETARCH
ARG TARGETVARIANT
ARG FFMPEG_URL_ARM64="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linuxarm64-lgpl.tar.xz"
ARG FFMPEG_URL_X64="https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz"
ARG DEBIAN_FRONTEND=noninteractive
# Set working directory
WORKDIR /app
# Preserve downloaded APT packages and remove docker-clean configuration
RUN rm -f /etc/apt/apt.conf.d/docker-clean; echo 'Binary::apt::APT::Keep-Downloaded-Packages "true";' > /etc/apt/apt.conf.d/keep-cache
# Add non-free repository for specific drivers
#RUN echo "deb http://deb.debian.org/debian $(lsb_release -cs) contrib non-free non-free-firmware" >> /etc/apt/sources.list
RUN sed -i "s/Components: main/Components: main contrib non-free non-free-firmware/" /etc/apt/sources.list.d/debian.sources
# Install dependencies with apt
RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/apt \
apt-get update -yq \
&& apt-get upgrade -yq \
&& apt-get install -yq --no-install-recommends \
xz-utils \
fuse \
libgdiplus \
vlc-bin \
gosu \
postgresql \
postgresql-common \
curl \
gnupg \
lsb-release \
iputils-ping \
pipx
RUN --mount=type=cache,id=apt-$TARGETARCH$TARGETVARIANT,sharing=locked,target=/var/cache/apt \
if [ "$TARGETARCH" = "amd64" ]; then \
apt-get update -yq \
&& apt-get install -yq --no-install-recommends \
mesa-va-drivers \
intel-media-va-driver-non-free; \
else \
echo "Skipping mesa-va-drivers and intel-media-va-driver-non-free installation for $TARGETARCH"; \
fi
RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /docker-entrypoint-initdb.d
# Conditional FFmpeg URL based on architecture
RUN if [ "$TARGETARCH" = "arm64" ]; then \
export FFMPEG_URL=$FFMPEG_URL_ARM64; \
else \
export FFMPEG_URL=$FFMPEG_URL_X64; \
fi \
&& curl -L -o /tmp/ffmpeg.tar.xz $FFMPEG_URL \
&& mkdir -p /tmp/ffmpeg/ \
&& tar -Jxvvf /tmp/ffmpeg.tar.xz --strip-components=1 -C /tmp/ffmpeg/ \
&& cp /tmp/ffmpeg/bin/ffmpeg /usr/local/bin/ \
&& cp /tmp/ffmpeg/bin/ffprobe /usr/local/bin/ \
&& chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe \
&& rm -rf /tmp/ffmpeg.tar.xz /tmp/ffmpeg/
ENV PIPX_BIN_DIR=/usr/local/bin
ENV PIPX_HOME=/opt/pipx
# Pipx utilities
RUN pipx install streamlink
RUN pipx install yt-dlp