coturn / Dockerfile
privateone's picture
Update Dockerfile
080a3dc verified
raw
history blame
1.91 kB
FROM coturn/coturn:edge-debian
USER root
# Install dependencies: coturn, openssl, curl (for ngrok install), bash, socat
# RUN apk add --no-cache coturn openssl curl bash
# # Download and install ngrok (latest Linux amd64)
# RUN curl -s https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-v3-stable-linux-amd64.zip -o /tmp/ngrok.zip \
# && unzip /tmp/ngrok.zip -d /usr/local/bin \
# && rm /tmp/ngrok.zip \
# && chmod +x /usr/local/bin/ngrok
RUN apt update \
&& apt-get install -y openssl curl bash
RUN curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
| tee /etc/apt/sources.list.d/ngrok.list \
&& apt-get update \
&& apt-get install -y ngrok \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /home/user
# All users can use /home/user as their home directory
ENV HOME=/home/user
RUN mkdir $HOME/.cache $HOME/.config \
&& chmod -R 777 $HOME
# Install socat and openssl for certificate generation
# RUN apk add --no-cache socat openssl
# Create cert directory
# RUN mkdir -p /etc/turn/certs
# Generate self-signed cert and private key (valid 365 days)
# RUN openssl req -x509 -nodes -newkey rsa:2048 \
# -keyout /etc/turn/certs/turn_server_pkey.pem \
# -out /etc/turn/certs/turn_server_cert.pem \
# -days 365 \
# -subj "/C=US/ST=State/L=City/O=Org/OU=Unit/CN=privateone-cotun.hf.space"
# Set cert directory permissions
# RUN chmod 600 /etc/turn/certs/*
# Copy your custom entrypoint script
RUN mkdir -p /custom-entrypoint ~/.ngrok2
COPY ngrok.yml ~/.ngrok2/ngrok.yml
COPY custom-entrypoint.sh /custom-entrypoint/entrypoint.sh
RUN chmod +x /custom-entrypoint/entrypoint.sh ~/.ngrok2/ngrok.yml
# Expose port 7860 TCP and UDP
EXPOSE 7860 7860/udp
# Set custom entrypoint
ENTRYPOINT ["/custom-entrypoint/entrypoint.sh"]