forked from AirenSoft/OvenMediaEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.local
56 lines (44 loc) · 1.75 KB
/
Dockerfile.local
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
FROM ubuntu:20.04 AS base
## Install libraries by package
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y tzdata sudo curl
FROM base AS build
WORKDIR /tmp
ARG OME_VERSION=local
ARG STRIP=TRUE
ARG GPU=FALSE
ENV PREFIX=/opt/ovenmediaengine
ENV TEMP_DIR=/tmp/ome
## Copy code to image
COPY ./ ${TEMP_DIR}/
## Install dependencies
RUN \
if [ "$GPU" = "TRUE" ] ; then \
${TEMP_DIR}/misc/install_nvidia_docker_image.sh ; \
${TEMP_DIR}/misc/prerequisites.sh --enable-nvc ; \
else \
${TEMP_DIR}/misc/prerequisites.sh ; \
fi
## Build OvenMediaEngine
RUN \
cd ${TEMP_DIR}/src && \
make release -j$(nproc)
RUN \
if [ "$STRIP" = "TRUE" ] ; then strip ${TEMP_DIR}/src/bin/RELEASE/OvenMediaEngine ; fi
## Make running environment
RUN \
cd ${TEMP_DIR}/src && \
mkdir -p ${PREFIX}/bin/origin_conf && \
mkdir -p ${PREFIX}/bin/edge_conf && \
cp ./bin/RELEASE/OvenMediaEngine ${PREFIX}/bin/ && \
cp ../misc/conf_examples/Origin.xml ${PREFIX}/bin/origin_conf/Server.xml && \
cp ../misc/conf_examples/Logger.xml ${PREFIX}/bin/origin_conf/Logger.xml && \
cp ../misc/conf_examples/Edge.xml ${PREFIX}/bin/edge_conf/Server.xml && \
cp ../misc/conf_examples/Logger.xml ${PREFIX}/bin/edge_conf/Logger.xml && \
rm -rf ${DIR}
FROM base AS release
WORKDIR /opt/ovenmediaengine/bin
EXPOSE 80/tcp 8080/tcp 8090/tcp 1935/tcp 3333/tcp 3334/tcp 4000-4005/udp 10000-10010/udp 9000/tcp
COPY --from=build /opt/ovenmediaengine /opt/ovenmediaengine
# Default run as Origin mode
CMD ["/opt/ovenmediaengine/bin/OvenMediaEngine", "-c", "origin_conf"]