-
-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 2.59 KB
/
Dockerfile
File metadata and controls
73 lines (58 loc) · 2.59 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
# syntax=docker/dockerfile:1
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal AS build-env
WORKDIR /app
# Install pre-requisite packages.
# Download the Microsoft repository GPG keys
# Register the Microsoft repository GPG keys
# Update the list of packages after we added packages.microsoft.com
RUN apt-get update && \
apt-get install -y wget apt-transport-https software-properties-common && \
wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb && \
dpkg -i packages-microsoft-prod.deb && \
apt-get update && \
apt-get install -y powershell
COPY ./ ./
# Copy everything else and build
RUN pwsh ./build/build-plugins.ps1
FROM mcr.microsoft.com/dotnet/sdk:6.0-focal
############################################################
### Prepare the docker with ffmpeg and hardware encoders ###
############################################################
ENV LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri" \
LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu" \
NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \
NVIDIA_VISIBLE_DEVICES="all"
# ffmpeg from jellyfin, a little older but precompiled for us
RUN apt-get update && \
apt install -y wget gnupg && \
wget https://repo.jellyfin.org/releases/server/ubuntu/versions/jellyfin-ffmpeg/4.3.2-1/jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb && \
apt install -y \
./jellyfin-ffmpeg_4.3.2-1-focal_amd64.deb && \
# link to /user/local/bin to make it available globally
ln -s /usr/lib/jellyfin-ffmpeg/ffmpeg /usr/local/bin/ffmpeg
# add support for intel hardware enconding
RUN curl -s https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \
# add the intel repo to the sources
echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel-graphics.list && \
# update the apt-get repo
apt-get update && \
apt-get install -y --no-install-recommends \
# do the actual intel install
intel-media-va-driver-non-free vainfo mesa-va-drivers ffmpeg
# install libssl-dev, needed for the asp.net application to run
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get dist-upgrade -y \
&& apt-get install -fy \
libssl-dev
##########################################
### actual FileFlows stuff happens now ###
##########################################
# expose the ports we need
EXPOSE 5000
# copy the deploy file into the app directory
COPY --from=build-env /app/out /app
# set the working directory
WORKDIR /app
# run the server
ENTRYPOINT [ "dotnet", "/app/FileFlows.dll", "--urls", "http://*:5000" ]