22
33FROM golang:1.17.5-alpine3.15
44
5+ # Build arguments.
6+ #
7+ # Override on the docker command line with
8+ # --build-arg USE_TSL_SOCKETS=false
9+ # --build-arg ENABLE_HOST_CHECK=false
10+ #
11+ ARG USE_TSL_SOCKETS=true
12+ ARG ENABLE_HOST_CHECK=true
13+
14+
515# Install and download deps.
616RUN apk add --no-cache git curl python2 build-base openssl-dev openssl
717RUN git clone https://github.com/webrtc/apprtc.git
@@ -21,7 +31,7 @@ RUN python apprtc/build/build_app_engine_package.py apprtc/src/ apprtc/out/ \
2131
2232# Wrap AppRTC GAE app in a bash script due to needing to run two apps within one container.
2333RUN echo -e "#!/bin/sh\n " > /go/start.sh \
24- && echo -e "`pwd`/google-cloud-sdk/bin/dev_appserver.py --host 0.0.0.0 `pwd`/apprtc/out/app.yaml &\n " >> /go/start.sh
34+ && echo -e "`pwd`/google-cloud-sdk/bin/dev_appserver.py --host 0.0.0.0 --enable_host_checking=$ENABLE_HOST_CHECK `pwd`/apprtc/out/app.yaml &\n " >> /go/start.sh
2535
2636# Collider setup
2737# Go environment setup.
@@ -36,7 +46,7 @@ RUN ln -s `pwd`/apprtc/src/collider/collidermain $GOPATH/src \
3646 && go install collidermain
3747
3848# Add Collider executable to the start.sh bash script.
39- RUN echo -e "$GOPATH/bin/collidermain -port=8089 -tls=true -room-server=http://localhost &\n " >> /go/start.sh
49+ RUN echo -e "$GOPATH/bin/collidermain -port=8089 -tls=$USE_TSL_SOCKETS -room-server=http://localhost &\n " >> /go/start.sh
4050
4151ENV STUNNEL_VERSION 5.60
4252
@@ -71,9 +81,10 @@ CMD /go/start.sh
7181
7282# # Instructions (Tested on Debian 11 only):
7383# - Download the Dockerfile from the AppRTC repo and put it in a folder, e.g. 'apprtc'
74- # - Build the Dockerfile into an image: 'sudo docker build apprtc/'
75- # Note the image ID from the build command, e.g. something like 'Successfully built 503621f4f7bd'.
76- # - Run: 'sudo docker run -p 443:443 -p 8089:8089 --rm -ti 503621f4f7bd'
84+ # - Build the Dockerfile into an image: 'sudo docker build apprtc/ --tag apprtc:latest'
85+ # If you want to disable TLS (not recommended) add '--build-arg USE_TSL_SOCKETS=false' to that command.
86+ # If you want to allow connection from any remote client, add '--build-arg ENABLE_HOST_CHECK=false'.
87+ # - Run: 'sudo docker run -p 443:443 -p 8080:8080 -p 8089:8089 --rm -ti apprtc:latest'
7788# The container will now run in interactive mode and output logging. If you do not want this, omit the '-ti' argument.
7889# The '-p' options are port mappings to the GAE app and Collider instances, the host ones can be changed.
7990#
0 commit comments