Dockerfile 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. # vim:set ft=dockerfile:
  2. ARG DEBIAN_VERSION=bookworm
  3. FROM debian:${DEBIAN_VERSION}
  4. # ARGs are cleared after every FROM
  5. # see: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
  6. ARG DEBIAN_VERSION
  7. ARG TOKEN
  8. # By default, install the full set of FreeSWITCH packages. Specify an alternative with:
  9. # --build-arg="FS_META_PACKAGE=freeswitch-meta-vanilla"
  10. # alternatives include:
  11. # freeswitch-meta-bare
  12. # freeswitch-meta-vanilla
  13. # freeswitch-meta-sorbet
  14. # freeswitch-meta-all-dbg
  15. ARG FS_META_PACKAGE=freeswitch-meta-all
  16. # Source Dockerfile:
  17. # https://github.com/docker-library/postgres/blob/master/9.4/Dockerfile
  18. # explicitly set user/group IDs
  19. RUN groupadd -r freeswitch --gid=999 && useradd -r -g freeswitch --uid=999 freeswitch
  20. # make the "en_US.UTF-8" locale so freeswitch will be utf-8 enabled by default
  21. RUN apt-get update -qq \
  22. && apt-get install -y --no-install-recommends ca-certificates gnupg2 gosu locales wget \
  23. && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  24. ENV LANG en_US.utf8
  25. # https://freeswitch.org/confluence/display/FREESWITCH/Debian
  26. # https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/Linux/Debian_67240088/
  27. RUN wget --no-verbose --http-user=signalwire --http-password=${TOKEN} \
  28. -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg \
  29. https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg \
  30. && echo "machine freeswitch.signalwire.com login signalwire password ${TOKEN}" > /etc/apt/auth.conf \
  31. && echo "deb [signed-by=/usr/share/keyrings/signalwire-freeswitch-repo.gpg] https://freeswitch.signalwire.com/repo/deb/debian-release/ ${DEBIAN_VERSION} main" > /etc/apt/sources.list.d/freeswitch.list \
  32. && apt-get -qq update \
  33. && apt-get install -y ${FS_META_PACKAGE} \
  34. && apt-get purge -y --auto-remove \
  35. && apt-get clean && rm -rf /var/lib/apt/lists/*
  36. COPY docker-entrypoint.sh /
  37. # Add anything else here
  38. ## Ports
  39. # Document ports used by this container
  40. ### 8021 fs_cli, 5060 5061 5080 5081 sip and sips, 5066 ws, 7443 wss, 8081 8082 verto, 16384-32768, 64535-65535 rtp
  41. EXPOSE 8021/tcp
  42. EXPOSE 5060/tcp 5060/udp 5080/tcp 5080/udp
  43. EXPOSE 5061/tcp 5061/udp 5081/tcp 5081/udp
  44. EXPOSE 5066/tcp
  45. EXPOSE 7443/tcp
  46. EXPOSE 8081/tcp 8082/tcp
  47. EXPOSE 64535-65535/udp
  48. EXPOSE 16384-32768/udp
  49. # Volumes
  50. ## Freeswitch Configuration
  51. VOLUME ["/etc/freeswitch"]
  52. ## Tmp so we can get core dumps out
  53. VOLUME ["/tmp"]
  54. # Limits Configuration
  55. COPY build/freeswitch.limits.conf /etc/security/limits.d/
  56. # Healthcheck to make sure the service is running
  57. SHELL ["/bin/bash", "-c"]
  58. HEALTHCHECK --interval=15s --timeout=5s \
  59. CMD fs_cli -x status | grep -q ^UP || exit 1
  60. ENTRYPOINT ["/docker-entrypoint.sh"]
  61. CMD ["freeswitch"]