This repository has been archived by the owner on May 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
/
Dockerfile
81 lines (70 loc) · 2.13 KB
/
Dockerfile
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
74
75
76
77
78
79
80
81
# https://hub.docker.com/_/alpine
FROM alpine:3.12
ARG coturn_ver=4.5.2
# Build and install Coturn.
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
ca-certificates \
curl \
&& update-ca-certificates \
\
# Install Coturn dependencies.
&& apk add --no-cache \
libevent \
libcrypto1.1 libssl1.1 \
libpq mariadb-connector-c sqlite-libs \
hiredis \
mongo-c-driver \
\
# Install tools for building.
&& apk add --no-cache --virtual .tool-deps \
coreutils autoconf g++ libtool make \
\
# Install Coturn build dependencies.
&& apk add --no-cache --virtual .build-deps \
linux-headers \
libevent-dev \
openssl-dev \
postgresql-dev mariadb-connector-c-dev sqlite-dev \
hiredis-dev \
mongo-c-driver-dev \
\
# Download and prepare Coturn sources.
&& curl -fL -o /tmp/coturn.tar.gz \
https://github.com/coturn/coturn/archive/${coturn_ver}.tar.gz \
&& tar -xzf /tmp/coturn.tar.gz -C /tmp/ \
&& cd /tmp/coturn-* \
\
# Build Coturn from sources.
&& ./configure --prefix=/usr \
--turndbdir=/var/lib/coturn \
--disable-rpath \
--sysconfdir=/etc/coturn \
# No documentation included to keep image size smaller.
--mandir=/tmp/coturn/man \
--docsdir=/tmp/coturn/docs \
--examplesdir=/tmp/coturn/examples \
&& make \
\
# Install and configure Coturn.
&& make install \
# Preserve license file.
&& mkdir -p /usr/share/licenses/coturn/ \
&& cp /tmp/coturn/docs/LICENSE /usr/share/licenses/coturn/ \
# Remove default config file.
&& rm -f /etc/coturn/turnserver.conf.default \
\
# Cleanup unnecessary stuff.
&& apk del .tool-deps .build-deps \
&& rm -rf /var/cache/apk/* \
/tmp/*
COPY rootfs /
RUN chmod +x /usr/local/bin/docker-entrypoint.sh \
/usr/local/bin/detect-external-ip.sh \
&& ln -s /usr/local/bin/detect-external-ip.sh \
/usr/local/bin/detect-external-ip
EXPOSE 3478 3478/udp
VOLUME ["/var/lib/coturn"]
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["--log-file=stdout", "--external-ip=$(detect-external-ip)"]