forked from carlreid/StreamMaster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.base
65 lines (57 loc) · 2.27 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
# Set the base image for the ASP.NET Core application
FROM mcr.microsoft.com/dotnet/aspnet:8.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
# 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 \
vlc-bin \
gosu \
postgresql \
postgresql-common \
curl \
gnupg \
lsb-release \
iputils-ping \
pipx \
&& 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 \
echo "Setting FFMPEG_URL to ARM64"; \
export FFMPEG_URL=$FFMPEG_URL_ARM64; \
else \
echo "Setting FFMPEG_URL to X64"; \
export FFMPEG_URL=$FFMPEG_URL_X64; \
fi \
&& echo "Downloading FFmpeg from $FFMPEG_URL" \
&& curl -L -o /tmp/ffmpeg.tar.xz $FFMPEG_URL \
&& echo "FFmpeg downloaded to /tmp/ffmpeg.tar.xz" \
&& mkdir -p /tmp/ffmpeg/ \
&& echo "Extracting FFmpeg..." \
&& tar -Jxvvf /tmp/ffmpeg.tar.xz --strip-components=1 -C /tmp/ffmpeg/ \
&& echo "Copying FFmpeg binaries..." \
&& cp /tmp/ffmpeg/bin/ffmpeg /usr/local/bin/ \
&& cp /tmp/ffmpeg/bin/ffprobe /usr/local/bin/ \
&& echo "Setting execute permissions on FFmpeg binaries..." \
&& chmod +x /usr/local/bin/ffmpeg /usr/local/bin/ffprobe \
&& echo "Cleaning up..." \
&& rm -rf /tmp/ffmpeg.tar.xz /tmp/ffmpeg/ \
&& echo "FFmpeg installation completed."
ENV PIPX_BIN_DIR=/usr/local/bin
ENV PIPX_HOME=/opt/pipx
# Pipx utilities
RUN pipx install streamlink
RUN pipx install yt-dlp