2
0

Dockerfile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. ARG FREESWITCH_UID=499
  20. ARG FREESWITCH_GID=499
  21. RUN groupadd -r freeswitch --gid=${FREESWITCH_GID} && useradd -r -g freeswitch --uid=${FREESWITCH_UID} freeswitch
  22. # make the "en_US.UTF-8" locale so freeswitch will be utf-8 enabled by default
  23. RUN apt-get update -qq \
  24. && apt-get install -y --no-install-recommends ca-certificates gnupg2 gosu locales wget \
  25. && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  26. ENV LANG en_US.utf8
  27. # https://freeswitch.org/confluence/display/FREESWITCH/Debian
  28. # https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Installation/Linux/Debian_67240088/
  29. RUN wget --no-verbose --http-user=signalwire --http-password=${TOKEN} \
  30. -O /usr/share/keyrings/signalwire-freeswitch-repo.gpg \
  31. https://freeswitch.signalwire.com/repo/deb/debian-release/signalwire-freeswitch-repo.gpg \
  32. && echo "machine freeswitch.signalwire.com login signalwire password ${TOKEN}" > /etc/apt/auth.conf \
  33. && 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 \
  34. && apt-get -qq update \
  35. && apt-get install -y ${FS_META_PACKAGE} \
  36. && apt-get purge -y --auto-remove \
  37. && apt-get clean && rm -rf /var/lib/apt/lists/*
  38. COPY docker-entrypoint.sh /
  39. # Add anything else here
  40. ## Ports
  41. # Document ports used by this container
  42. ### 8021 fs_cli, 5060 5061 5080 5081 sip and sips, 5066 ws, 7443 wss, 8081 8082 verto, 16384-32768, 64535-65535 rtp
  43. EXPOSE 8021/tcp
  44. EXPOSE 5060/tcp 5060/udp 5080/tcp 5080/udp
  45. EXPOSE 5061/tcp 5061/udp 5081/tcp 5081/udp
  46. EXPOSE 5066/tcp
  47. EXPOSE 7443/tcp
  48. EXPOSE 8081/tcp 8082/tcp
  49. EXPOSE 64535-65535/udp
  50. EXPOSE 16384-32768/udp
  51. # Volumes
  52. ## Freeswitch Configuration
  53. VOLUME ["/etc/freeswitch"]
  54. ## Tmp so we can get core dumps out
  55. VOLUME ["/tmp"]
  56. # Limits Configuration
  57. COPY build/freeswitch.limits.conf /etc/security/limits.d/
  58. # Healthcheck to make sure the service is running
  59. SHELL ["/bin/bash", "-c"]
  60. HEALTHCHECK --interval=15s --timeout=5s \
  61. CMD fs_cli -x status | grep -q ^UP || exit 1
  62. ENTRYPOINT ["/docker-entrypoint.sh"]
  63. CMD ["freeswitch"]