]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10106 [Docker] Updates to Docker Configuration
authorRichard Genthner <moose@Richards-MacBook-Pro.local>
Wed, 8 Mar 2017 15:20:05 +0000 (10:20 -0500)
committerRichard Genthner <moose@Richards-MacBook-Pro.local>
Wed, 8 Mar 2017 15:20:05 +0000 (10:20 -0500)
Updates for the docker configuration to allow for the following:

- Allow for bring in own configuration
- Exposes the Ports needed for non-docker networking
- Allows for mount /tmp to write out logs, etc to the host machine if
  configured as so.
- Health check of the freeswitch service

docker/README
docker/master/Dockerfile
docker/master/build/freeswitch.limits.conf [new file with mode: 0644]
docker/release/Dockerfile
docker/release/build/freeswitch.limits.conf [new file with mode: 0644]

index 564d700dbc1d70c0be55cb3b18901179a96f01d2..c18afbbdd4d3ace809069bbaf46673d97dcafd81 100644 (file)
@@ -1,4 +1,33 @@
-This is not OSHA approved, It may when used incorrectly cause workplace violence.
+# Docker Setup
+These are the official Docker files for master branch and the current release packages.
+
+## Volumes
+These containers are setup so that you can mount your freeswitch configuration form a host or data volume container.
+
+To mount freeswitch Configuration
+```
+-v $(pwd)/configuration:/etc/freeswitch
+```
+
+To mount tmp directory for storing recordings, etc
+```
+-v $(pwd)/tmp:/tmp
+```
+
+The container also has a healthcheck where it does a fs_cli status check to make sure the freeswitch service is still running.
+
+# Ports
+
+The container exposes the following ports:
+
+- 5060/tcp 5060/udp 5080/tcp 5080/udp as SIP Signaling ports.
+- 5066/tcp 7443/tcp as WebSocket Signaling ports.
+- 8021/tcp as Event Socket port.
+- 64535-65535/udp as media ports.
+- 16384-32768/udp
+
+
+
 
 If you wish to help improve these please submit a pull request at:
 
@@ -6,4 +35,3 @@ https://freeswitch.org/jira
 
 Thanks,
 /b
-
index f9191bac41f9e6e4d211c94f91a26d97b09a42c4..0b5f69083392d27011b680e1247a17043e5b916b 100644 (file)
@@ -41,8 +41,36 @@ RUN apt-get update && apt-get install -y freeswitch-all \
 COPY docker-entrypoint.sh /
 # Add anything else here
 
-##
+## Ports
+# Open the container up to the world.
+### 8021 fs_cli, 5060 5061 5080 5081 sip and sips, 64535-65535 rtp
+EXPOSE 8021/tcp
+EXPOSE 5060/tcp 5060/udp 5080/tcp 5080/udp
+EXPOSE 5061/tcp 5061/udp 5081/tcp 5081/udp
+EXPOSE 7443/tcp
+EXPOSE 5070/udp 5070/tcp
+EXPOSE 64535-65535/udp
+EXPOSE 16384-32768/udp
+
+
+# Volumes
+## Freeswitch Configuration
+VOLUME ["/etc/freeswitch"]
+## Tmp so we can get core dumps out
+VOLUME ["/tmp"]
+
+# Limits Configuration
+COPY    build/freeswitch.limits.conf /etc/security/limits.d/
+
+# Healthcheck to make sure the service is running
+SHELL       ["/bin/bash"]
+HEALTHCHECK --interval=15s --timeout=5s \
+    CMD  fs_cli -x status | grep -q ^UP || exit 1
+
+# Clean up
+RUN apt-clean --aggressive
 
 ENTRYPOINT ["/docker-entrypoint.sh"]
 
+
 CMD ["freeswitch"]
diff --git a/docker/master/build/freeswitch.limits.conf b/docker/master/build/freeswitch.limits.conf
new file mode 100644 (file)
index 0000000..d6568eb
--- /dev/null
@@ -0,0 +1,15 @@
+freeswitch       soft    core            unlimited
+freeswitch       soft    data            unlimited
+freeswitch       soft    fsize           unlimited
+freeswitch       soft    memlock         unlimited
+freeswitch       soft    nofile          999999
+freeswitch       soft    rss             unlimited
+freeswitch       hard    stack           240
+freeswitch       soft    cpu             unlimited
+freeswitch       soft    nproc           unlimited
+freeswitch       soft    as              unlimited
+freeswitch       soft    priority        -11
+freeswitch       soft    locks           unlimited
+freeswitch       soft    sigpending      unlimited
+freeswitch       soft    msgqueue        unlimited
+freeswitch       soft    nice            -11
index 8367946ae6123e517cd518dfecc1b2e42e82ba62..1e1f15bc458d5216b27d45448e91ce69c71e7ae3 100644 (file)
@@ -39,7 +39,36 @@ RUN apt-get update && apt-get install -y freeswitch-all \
     && apt-get clean && rm -rf /var/lib/apt/lists/*
 
 COPY docker-entrypoint.sh /
-# Add anything else here
+## Ports
+# Open the container up to the world.
+### 8021 fs_cli, 5060 5061 5080 5081 sip and sips, 64535-65535 rtp
+EXPOSE 8021/tcp
+EXPOSE 5060/tcp 5060/udp 5080/tcp 5080/udp
+EXPOSE 5061/tcp 5061/udp 5081/tcp 5081/udp
+EXPOSE 7443/tcp
+EXPOSE 5070/udp 5070/tcp
+EXPOSE 64535-65535/udp
+EXPOSE 16384-32768/udp
+
+
+# Volumes
+## Freeswitch Configuration
+VOLUME ["/etc/freeswitch"]
+## Tmp so we can get core dumps out
+VOLUME ["/tmp"]
+
+# Limits Configuration
+COPY    build/freeswitch.limits.conf /etc/security/limits.d/
+
+# Healthcheck to make sure the service is running
+SHELL       ["/bin/bash"]
+HEALTHCHECK --interval=15s --timeout=5s \
+    CMD  fs_cli -x status | grep -q ^UP || exit 1
+
+# Clean up
+RUN apt-clean --aggressive
+
+## Add additional things here
 
 ##
 
diff --git a/docker/release/build/freeswitch.limits.conf b/docker/release/build/freeswitch.limits.conf
new file mode 100644 (file)
index 0000000..d6568eb
--- /dev/null
@@ -0,0 +1,15 @@
+freeswitch       soft    core            unlimited
+freeswitch       soft    data            unlimited
+freeswitch       soft    fsize           unlimited
+freeswitch       soft    memlock         unlimited
+freeswitch       soft    nofile          999999
+freeswitch       soft    rss             unlimited
+freeswitch       hard    stack           240
+freeswitch       soft    cpu             unlimited
+freeswitch       soft    nproc           unlimited
+freeswitch       soft    as              unlimited
+freeswitch       soft    priority        -11
+freeswitch       soft    locks           unlimited
+freeswitch       soft    sigpending      unlimited
+freeswitch       soft    msgqueue        unlimited
+freeswitch       soft    nice            -11