networked-aframe / janus-plugin-sfu

Janus plugin to act as a kind of SFU for game networking data.
Mozilla Public License 2.0
2 stars 5 forks source link

Docker image #3

Closed vincentfretin closed 2 years ago

vincentfretin commented 2 years ago

This is the docker image I'm currently using. The Dockerfile uses the same instructions as the current install doc with an ubuntu instance with systemd, except using latest 0.x branch janus-gateway (a commit post 0.11.8) and the disable-subscribe-message branch #2

The start.sh script is using sed commands to replace some environment variables in the config files. I left the .sample files that are created in a default 0.11.8 janus install, so you can compare for example janus.jcfg.sample and janus.jcfg to see what options I changed that may not be configurable via environment variables in my start.sh entrypoint script. Instead of sed commands, we could use modify janus.jcfg with dollar variables and use the envsubst command (in the gettext-base package on ubuntu), or any other light template system. I didn't know about envsubst command when I did this script. A good point of not replacing all options in janus.jcfg (and the other conf files) with variables allows me compare easily the files with the original files.

Instead of relying on an external service to get the public ip when the janus container starts, see start.sh line 13 we could use a dns query like they did on the new official coturn docker image https://github.com/coturn/coturn/blob/master/docker/coturn/rootfs/usr/local/bin/detect-external-ip.sh

vincentfretin commented 2 years ago

I'm merging it. If you want to contribute to this docker image, PRs are welcome.

vincentfretin commented 2 years ago

The image currently include all the build tools, the final image is 1GB. We could modify the Dockerfile to have a build stage and runtime stage. This is not on my roadmap to work on it, but if you do and have a build working, I gladly review your PR.

vincentfretin commented 2 years ago

To read the documentation, read it from https://github.com/networked-aframe/janus-plugin-sfu/tree/master/docker I did one additional commit in master after I merged.