forked from greenjim301-ux/media-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (60 loc) · 1.72 KB
/
Dockerfile
File metadata and controls
72 lines (60 loc) · 1.72 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
# Build stage
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
libssl-dev \
libavcodec-dev \
libavformat-dev \
libavutil-dev \
libswresample-dev \
libsqlite3-dev \
pkg-config \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Install LibDataChannel
WORKDIR /tmp
RUN git clone -b master --depth 1 https://github.com/paullouisageneau/libdatachannel.git && \
cd libdatachannel && \
git submodule update --init --recursive && \
cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DNO_EXAMPLES=ON -DNO_TESTS=ON && \
cmake --build build -j$(nproc) && \
cmake --install build
# Build Media Server
WORKDIR /app
COPY . .
RUN cmake -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_HTTPS=OFF -DENABLE_RTC=ON && \
cmake --build build -j$(nproc)
# Runtime stage
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
libssl3 \
libavcodec60 \
libavformat60 \
libavutil58 \
libswresample4 \
libsqlite3-0 \
ca-certificates \
net-tools \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy LibDataChannel libraries from builder
COPY --from=builder /usr/lib/x86_64-linux-gnu/libdatachannel* /usr/lib/x86_64-linux-gnu/
# Copy application artifacts
WORKDIR /app
COPY --from=builder /app/output .
# Expose ports based on default config
EXPOSE 26080/tcp
EXPOSE 26090/tcp
EXPOSE 26090/udp
EXPOSE 5080/tcp
EXPOSE 5080/udp
# Define volumes for persistent data
VOLUME ["/app/conf", "/app/log", "/app/files"]
# Run the media server
ENTRYPOINT ["./media_server"]