This repository has been archived on 2024-02-28. You can view files and clone it, but cannot push or open issues or pull requests.
coturn/Dockerfile
2021-08-18 21:05:07 +00:00

49 lines
1.9 KiB
Docker

ARG ARCH
FROM debian:11.0-slim@sha256:2a6fd917bbc6b8c0c4f5d05b2f831b27003dc24df486e3ec8b3f563fe9c06503 AS base-amd64
FROM arm32v7/debian:11.0-slim@sha256:d25d98cd76eec0baf9f4d8b19525704ded1c53c3263f7573ad0f2530369cd167 AS base-arm
FROM arm64v8/debian:11.0-slim@sha256:9f3995fceb697af94122fcb9fe7457e3bc68090fcb86692ff83a4bf526d45b48 AS base-arm64
FROM base-${ARCH}
ENV COTURN_VERSION="4.5.2"
ENV PROMETHEUS_CLIENT_VERSION="v0.1.3"
ENV BUILD_PREFIX /usr/local/src
WORKDIR /root/coturn
RUN apt-get update && apt-get dist-upgrade -y && apt-get install -y \
build-essential="12.6" \
pkg-config="0.29.2-1" \
libssl-dev="1.1.1k-1" \
libevent-dev="2.1.12-stable-1" \
curl \
&& PCV=$(echo "${PROMETHEUS_CLIENT_VERSION}" | cut -c 2-) \
&& curl -L "https://github.com/digitalocean/prometheus-client-c/releases/download/${PROMETHEUS_CLIENT_VERSION}/libprom-dev-${PCV}-Linux.deb" > /tmp/libprom.deb \
&& curl -L "https://github.com/digitalocean/prometheus-client-c/releases/download/${PROMETHEUS_CLIENT_VERSION}/libpromhttp-dev-${PCV}-Linux.deb" > /tmp/libpromhttp.deb \
&& apt-get install -y /tmp/libprom.deb \
&& apt-get install -y /tmp/libpromhttp.deb \
&& rm /tmp/libprom.deb /tmp/libpromhttp.deb \
&& curl -L "https://github.com/coturn/coturn/archive/${COTURN_VERSION}.tar.gz" | tar xvz --strip 1 \
&& ./configure \
&& make \
&& make install \
&& rm -rf /root/coturn \
&& apt-get remove -y --purge curl
RUN addgroup --system turnserver \
&& adduser --system --home / --shell /bin/false --no-create-home --ingroup turnserver --disabled-password --disabled-login --gecos "turnserver daemon" turnserver
WORKDIR /
USER turnserver
# SUTN/TURN PORTS
EXPOSE 3478 3479 3478/udp 3479/udp 80 80/udp
EXPOSE 5349 5350 5349/udp 5350/udp 443 443/udp
# CLI
EXPOSE 5766
# Relay Ports
EXPOSE 49152-65535 49152-65535/udp
# Prometheus
EXPOSE 9641
ENTRYPOINT ["turnserver", "--pidfile", "/var/tmp/turnserver.pid"]