2
0

Dockerfile 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. # vim:set ft=dockerfile:
  2. FROM debian:jessie
  3. # Source Dockerfile:
  4. # https://github.com/docker-library/postgres/blob/master/9.4/Dockerfile
  5. # explicitly set user/group IDs
  6. RUN groupadd -r freeswitch --gid=999 && useradd -r -g freeswitch --uid=999 freeswitch
  7. # grab gosu for easy step-down from root
  8. RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
  9. RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && rm -rf /var/lib/apt/lists/* \
  10. && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
  11. && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
  12. && gpg --verify /usr/local/bin/gosu.asc \
  13. && rm /usr/local/bin/gosu.asc \
  14. && chmod +x /usr/local/bin/gosu \
  15. && apt-get purge -y --auto-remove ca-certificates wget
  16. # make the "en_US.UTF-8" locale so freeswitch will be utf-8 enabled by default
  17. RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
  18. && localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
  19. ENV LANG en_US.utf8
  20. # https://files.freeswitch.org/repo/deb/freeswitch-1.*/dists/jessie/main/binary-amd64/Packages
  21. ENV FS_MAJOR 1.6
  22. RUN sed -i "s/jessie main/jessie main contrib non-free/" /etc/apt/sources.list
  23. # https://freeswitch.org/confluence/display/FREESWITCH/Debian+8+Jessie#Debian8Jessie-InstallingfromDebianpackages
  24. RUN apt-get update && apt-get install -y curl \
  25. && curl https://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | apt-key add - \
  26. && echo "deb http://files.freeswitch.org/repo/deb/freeswitch-$FS_MAJOR/ jessie main" > /etc/apt/sources.list.d/freeswitch.list \
  27. && apt-get purge -y --auto-remove curl
  28. RUN apt-get update && apt-get install -y freeswitch-all \
  29. && apt-get clean && rm -rf /var/lib/apt/lists/*
  30. # Clean up
  31. RUN apt-get autoremove
  32. COPY docker-entrypoint.sh /
  33. ## Ports
  34. # Open the container up to the world.
  35. ### 8021 fs_cli, 5060 5061 5080 5081 sip and sips, 64535-65535 rtp
  36. EXPOSE 8021/tcp
  37. EXPOSE 5060/tcp 5060/udp 5080/tcp 5080/udp
  38. EXPOSE 5061/tcp 5061/udp 5081/tcp 5081/udp
  39. EXPOSE 7443/tcp
  40. EXPOSE 5070/udp 5070/tcp
  41. EXPOSE 64535-65535/udp
  42. EXPOSE 16384-32768/udp
  43. # Volumes
  44. ## Freeswitch Configuration
  45. VOLUME ["/etc/freeswitch"]
  46. ## Tmp so we can get core dumps out
  47. VOLUME ["/tmp"]
  48. # Limits Configuration
  49. COPY build/freeswitch.limits.conf /etc/security/limits.d/
  50. # Healthcheck to make sure the service is running
  51. SHELL ["/bin/bash"]
  52. HEALTHCHECK --interval=15s --timeout=5s \
  53. CMD fs_cli -x status | grep -q ^UP || exit 1
  54. ## Add additional things here
  55. ##
  56. ENTRYPOINT ["/docker-entrypoint.sh"]
  57. CMD ["freeswitch"]