freeswitch/docker/master-min
king-dopey 902a80aa32
Update Busybox version in Docker Image
2024-05-26 22:13:38 -07:00
..
build Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00
hooks Added multi-tag Dockerhub image configuration 2024-02-12 22:43:54 -08:00
Dockerfile Update Busybox version in Docker Image 2024-05-26 22:13:38 -07:00
README.md Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00
docker-entrypoint.sh Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00
freeswitch-config.patch Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00
healthcheck.sh Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00
make_root_fs.sh Completed image configuration, for mulitple tags: 2024-02-12 22:27:07 -08:00
sounds_version.txt Combined the master and base docker images to create a minimized (app and dependency only) image based and the latest Debian images 2024-02-03 14:12:05 -08:00

README.md

About

This is an updated, minimized, official FreeSwitch docker image. Container designed to run on host network. Size of image decreased to 120MB (54MB compressed) Significantly increased security:

  1. removed all libs except libc, busybox, erlang, ca-certificates, gnupg2, passwd, curl, freeswitch and dependent libs.
  2. removed 'system' API command from vanila config
  3. updated FreeSwitch default SIP password to random value

Used environment variables

  1. SOUND_RATES - rates of sound files that must be downloaded and installed. Available values 8000, 16000, 32000, 48000. May defined multiply values using semicolon as delimiter. Example SOUND_RATES=8000:16000;
  2. SOUND_TYPES - types of sound files that must be downloaded and installed. Available values music, en-us-callie, en-us-allison, ru-RU-elena, en-ca-june, fr-ca-june, pt-BR-karina, sv-se-jakob, zh-cn-sinmei, zh-hk-sinmei. Example SOUND_TYPES=music:en-us-callie;
  3. EPMD - start epmd daemon, useful when you use mod_erlang and mod_kazoo FreeSwitch modules. Available values true, false.

Usage container

  1. Creating volume for sound files. This may be skipped if you not use freeswitch MOH and other sound files.
docker volume create --name freeswitch-sounds 
  1. Stating container
docker run --net=host --name freeswitch \
           -e SOUND_RATES=8000:16000 \
           -e SOUND_TYPES=music:en-us-callie \
           -v freeswitch-sounds:/usr/share/freeswitch/sounds \
           -v /etc/freeswitch/:/etc/freeswitch \
           dheaps/freeswitch

systemd unit file

You can use this systemd unit file on your hosts.

$ cat /etc/systemd/system/freeswitch-docker.service
[Unit]
Description=freeswitch Container
After=docker.service network-online.target
Requires=docker.service


[Service]
Restart=always
TimeoutStartSec=0
#One ExecStart/ExecStop line to prevent hitting bugs in certain systemd versions
ExecStart=/bin/sh -c 'docker rm -f freeswitch; \
          docker run -t --net=host --name freeswitch \
                 -e SOUND_RATES=8000:16000 \
                 -e SOUND_TYPES=music:en-us-callie \
                 -v freeswitch-sounds:/usr/share/freeswitch/sounds \
                 -v /etc/kazoo/freeswitch/:/etc/freeswitch \
                 dheaps/freeswitch'
ExecStop=-/bin/sh -c '/usr/bin/docker stop freeswitch; \
          /usr/bin/docker rm -f freeswitch;'

[Install]
WantedBy=multi-user.target

Unit file can be placed to /etc/systemd/system/freeswitch-docker.service and enabled by command

systemd start freeswitch-docker.service
systemd enable freeswitch-docker.service

.bashrc file

To simplify freeswitch management you can add alias for fs_cli to .bashrc file as example bellow.

alias fs_cli='docker exec -i -t freeswitch /usr/bin/fs_cli'

How to create custom container

This container created from scratch image by addiding required freeswitch files packaged to tar.gz archive. To create custom container:

  1. clone freeswitch repo
git clone https://github.com/signalwire/freeswitch.git
  1. modify freeswitch/docker/master-min/Dockerfile with customizations
  • Stage files are not inlcuded by default, but is the place to add additional packages/dependancies
  1. modify freeswitch/docker/master-min/make_root_fs.sh with customizations
  • If files/packages were added to the stage image add them here
  • Additional installed packages should be added to the PACKAGES variable in fs_files_debian()
  • Additinoal installed files should be added in make_new_root()
  1. build custom container
docker build -t freeswitch_custom .

Read more

Dockerfile of older official FreeSwitch image Dockerfile of the updated FreeSwitch image that this image is based on Dockerfile of minimized base image FreeSwitch image that this image is based on