expose ports, patch default config file in the build stage

This commit is contained in:
2025-03-18 16:25:01 -04:00
parent fed4d36f10
commit f25dfc4d3d

View File

@@ -54,6 +54,10 @@ RUN wget -c https://files.freeswitch.org/releases/freeswitch/freeswitch-1.10.12.
make cd-sounds-install && \
make cd-moh-install
# Patch default FreeSwitch config (fix IPv4 bug)
RUN sed -i 's/<param name="listen-ip" value="::"\/>/<param name="listen-ip" value="127.0.0.1"\/>/' \
/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
# Stage 2: Runtime Stage
FROM ubuntu:22.04
@@ -77,15 +81,32 @@ COPY --from=builder /usr/local/freeswitch/conf /usr/local/freeswitch/default-con
# Update linker cache
RUN ldconfig
# Modify FreeSwitch config (same as your sed command)
RUN sed -i 's/<param name="listen-ip" value="::"\/>/<param name="listen-ip" value="127.0.0.1"\/>/' \
/usr/local/freeswitch/conf/autoload_configs/event_socket.conf.xml
# Copy entrypoint
COPY ./entrypoint.sh /entrypoint.sh
# Set PATH
ENV PATH="$PATH:/usr/local/freeswitch/bin"
# Expose ports
# ref: https://developer.signalwire.com/freeswitch/FreeSWITCH-Explained/Networking/Firewall_1048908/
EXPOSE 1719/udp
EXPOSE 1720/tcp
EXPOSE 2855-2856/tcp
EXPOSE 3478/udp
EXPOSE 3479/udp
EXPOSE 5002/udp
EXPOSE 5003/udp
EXPOSE 5060/tcp
EXPOSE 5060/udp
EXPOSE 5070/tcp
EXPOSE 5070/udp
EXPOSE 5080/tcp
EXPOSE 5080/udp
EXPOSE 8021/tcp
EXPOSE 16384-32768/udp
EXPOSE 5066/tcp
EXPOSE 7443/tcp
EXPOSE 8081-8082/tcp
# Set working directory and command
WORKDIR /usr/local/freeswitch
ENTRYPOINT ["/entrypoint.sh"]